<?xml version="1.0" encoding="UTF-8"?>
<class name="Gelbfisch" extends="Actor" extends-java="Actor" enable="true" strideversion="1">
    <javadoc xml:space="preserve"/>
    <imports>
        <import target="java.util.*" enable="true"/>
        <import target="greenfoot.*" enable="true"/>
    </imports>
    <implements/>
    <fields>
        <variable access="private" type="int" type-java="int" name="geschwindigkeit" value="2" value-java="2" enable="true"/>
        <variable access="private" type="String" type-java="String" name="name" enable="true"/>
        <variable access="private" type="boolean" type-java="boolean" name="istEinFisch" enable="true"/>
        <variable access="private" type="int" type-java="int" name="seed" value="50" value-java="50" enable="true"/>
    </fields>
    <constructors>
        <constructor access="public" enable="true">
            <javadoc xml:space="preserve"/>
            <params>
                <param type="String" type-java="String" name="name"/>
                <param type="boolean" type-java="boolean" name="istEinFisch"/>
            </params>
            <throws/>
            <body>
                <assign dest="this.name" dest-java="this.name" src="name" src-java="name" enable="true"/>
                <assign dest="this.istEinFisch" dest-java="this.istEinFisch" src="istEinFisch" src-java="istEinFisch" enable="true"/>
            </body>
        </constructor>
    </constructors>
    <methods>
        <method access="public" type="void" type-java="void" name="act" enable="true">
            <javadoc xml:space="preserve">Act - do whatever the Fisch wants to do. This method is called whenever the 'Act' or 'Run' button gets pressed in the environment.</javadoc>
            <params/>
            <throws/>
            <body>
                <call expression="this.schwimmen(1)" expression-java="this.schwimmen(1)" enable="true"/>
                <if condition="this.isTouching(Gruenfisch.class)" condition-java="this.isTouching(Gruenfisch.class)" enable="true">
                    <ifStatements>
                        <call expression="this.setLocation(this.getX()+Greenfoot.getRandomNumber(Greenfoot.getRandomNumber(this.seed)+1),this.getY())" expression-java="this.setLocation(this.getX() + Greenfoot.getRandomNumber(Greenfoot.getRandomNumber(this.seed) + 1), this.getY())" enable="true"/>
                    </ifStatements>
                </if>
            </body>
        </method>
        <method access="public" type="boolean" type-java="boolean" name="schwimmen" enable="true">
            <javadoc xml:space="preserve"/>
            <params>
                <param type="int" type-java="int" name="zunahme"/>
            </params>
            <throws/>
            <body>
                <call expression="this.move(this.geschwindigkeit)" expression-java="this.move(this.geschwindigkeit)" enable="true"/>
                <variable type="int" type-java="int" name="zufallszahl" value="Greenfoot.getRandomNumber(2)" value-java="Greenfoot.getRandomNumber(2)" enable="true"/>
                <if condition="this.isAtEdge()&amp;&amp;zufallszahl==1" condition-java="this.isAtEdge() &amp;&amp; zufallszahl == 1" enable="true">
                    <ifStatements>
                        <assign dest="this.geschwindigkeit" dest-java="this.geschwindigkeit" src="this.geschwindigkeit+1" src-java="this.geschwindigkeit + 1" enable="true"/>
                        <assign dest="this.geschwindigkeit" dest-java="this.geschwindigkeit" src="-this.geschwindigkeit" src-java=" - this.geschwindigkeit" enable="true"/>
                        <if condition="this.geschwindigkeit&gt;3" condition-java="this.geschwindigkeit &gt; 3" enable="true">
                            <ifStatements>
                                <assign dest="this.geschwindigkeit" dest-java="this.geschwindigkeit" src="1" src-java="1" enable="true"/>
                            </ifStatements>
                            <elseIf condition="this.geschwindigkeit&lt;-3" condition-java="this.geschwindigkeit &lt; -3">
                                <assign dest="this.geschwindigkeit" dest-java="this.geschwindigkeit" src="-1" src-java="-1" enable="true"/>
                            </elseIf>
                        </if>
                    </ifStatements>
                </if>
                <return value="true" value-java="true" enable="true"/>
            </body>
        </method>
        <method access="public" type="double" type-java="double" name="berechneG" enable="true">
            <javadoc xml:space="preserve"/>
            <params/>
            <throws/>
            <body>
                <return value="this.geschwindigkeit*this.seed" value-java="this.geschwindigkeit * this.seed" enable="true"/>
            </body>
        </method>
        <method access="public" type="void" type-java="void" name="ausgebenG" enable="true">
            <javadoc xml:space="preserve"/>
            <params/>
            <throws/>
            <body>
                <call expression="this.getWorld().showText(&quot;&quot;+this.berechneG(),200,100)" expression-java="this.getWorld().showText(&quot;&quot; + this.berechneG(), 200, 100)" enable="true"/>
            </body>
        </method>
    </methods>
</class>
