<?xml version="1.0" encoding="UTF-8"?>
<class name="Prinzessin" extends="Player" extends-java="Player" 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="targetXPos" enable="true"/>
        <variable access="private" type="int" type-java="int" name="targetYPos" enable="true"/>
        <variable access="private" type="int" type-java="int" name="mouseX" enable="true"/>
        <variable access="private" type="int" type-java="int" name="mouseY" enable="true"/>
        <variable access="private" type="boolean" type-java="boolean" name="movingToTarget" value="false" value-java="false" enable="true"/>
        <variable access="private" type="World" type-java="World" name="worldPrincessIsIn" enable="true"/>
        <variable access="private" type="String" type-java="String" name="nameOfWorld" enable="true"/>
        <variable access="private" type="int" type-java="int" name="credit" value="100" value-java="100" enable="true"/>
        <variable access="private" type="ArrayList&lt;Item&gt;" type-java="ArrayList&lt;Item&gt;" name="inventory" value="new ArrayList&lt;Item&gt;()" value-java=" new ArrayList &lt; Item &gt; ()" enable="true"/>
    </fields>
    <constructors>
        <constructor access="public" enable="true">
            <javadoc xml:space="preserve"/>
            <params/>
            <throws/>
            <body/>
        </constructor>
    </constructors>
    <methods>
        <method access="protected" type="void" type-java="void" name="addedToWorld" enable="true">
            <javadoc xml:space="preserve"/>
            <params>
                <param type="World" type-java="World" name="world"/>
            </params>
            <throws/>
            <body>
                <assign dest="this.worldPrincessIsIn" dest-java="this.worldPrincessIsIn" src="this.getWorld()" src-java="this.getWorld()" enable="true"/>
                <assign dest="this.nameOfWorld" dest-java="this.nameOfWorld" src="this.worldPrincessIsIn.getClass().getSimpleName()" src-java="this.worldPrincessIsIn.getClass().getSimpleName()" enable="true"/>
            </body>
        </method>
        <method access="public" type="void" type-java="void" name="act" enable="true">
            <javadoc xml:space="preserve">Act - do whatever the Prinzessin wants to do. This method is called whenever the 'Act' or 'Run' button gets pressed in the environment.</javadoc>
            <params/>
            <throws/>
            <body>
                <if condition="this.nameOfWorld.equals(&quot;Schlossgarten&quot;)" condition-java="this.nameOfWorld.equals(&quot;Schlossgarten&quot;)" enable="true">
                    <ifStatements>
                        <call expression="this.followMouse()" expression-java="this.followMouse()" enable="true"/>
                    </ifStatements>
                    <else>
                        <call expression="this.followMouse()" expression-java="this.followMouse()" enable="true"/>
                    </else>
                </if>
            </body>
        </method>
        <method access="public" type="void" type-java="void" name="followMouse" enable="true">
            <javadoc xml:space="preserve"/>
            <params/>
            <throws/>
            <body>
                <variable type="MouseInfo" type-java="MouseInfo" name="mouseInfo" value="Greenfoot.getMouseInfo()" value-java="Greenfoot.getMouseInfo()" enable="true"/>
                <if condition="mouseInfo!=null" condition-java="mouseInfo != null" enable="true">
                    <ifStatements>
                        <if condition="mouseInfo.getButton()==1" condition-java="mouseInfo.getButton() == 1" enable="true">
                            <ifStatements>
                                <assign dest="this.movingToTarget" dest-java="this.movingToTarget" src="true" src-java="true" enable="true"/>
                                <assign dest="this.targetXPos" dest-java="this.targetXPos" src="mouseInfo.getX()" src-java="mouseInfo.getX()" enable="true"/>
                                <assign dest="this.targetYPos" dest-java="this.targetYPos" src="mouseInfo.getY()" src-java="mouseInfo.getY()" enable="true"/>
                            </ifStatements>
                        </if>
                    </ifStatements>
                </if>
                <if condition="movingToTarget" condition-java="movingToTarget" enable="true">
                    <ifStatements>
                        <call expression="this.turnTowards(this.targetXPos,this.targetYPos)" expression-java="this.turnTowards(this.targetXPos, this.targetYPos)" enable="true"/>
                        <call expression="this.move(1)" expression-java="this.move(1)" enable="true"/>
                        <call expression="this.setRotation(0)" expression-java="this.setRotation(0)" enable="true"/>
                    </ifStatements>
                </if>
                <if condition="Greenfoot.isKeyDown(&quot;f&quot;)" condition-java="Greenfoot.isKeyDown(&quot;f&quot;)" enable="true">
                    <ifStatements>
                        <call expression="Greenfoot.setSpeed(65)" expression-java="Greenfoot.setSpeed(65)" enable="true"/>
                    </ifStatements>
                    <else>
                        <call expression="Greenfoot.setSpeed(50)" expression-java="Greenfoot.setSpeed(50)" enable="true"/>
                    </else>
                </if>
                <if condition="(this.getX()==this.targetXPos&amp;&amp;this.getY()==this.targetYPos)" condition-java="(this.getX() == this.targetXPos &amp;&amp; this.getY() == this.targetYPos)" enable="true">
                    <ifStatements>
                        <assign dest="this.movingToTarget" dest-java="this.movingToTarget" src="false" src-java="false" enable="true"/>
                    </ifStatements>
                </if>
            </body>
        </method>
        <method access="public" type="void" type-java="void" name="addToInventory" enable="true">
            <javadoc xml:space="preserve"/>
            <params>
                <param type="Item" type-java="Item" name="item"/>
            </params>
            <throws/>
            <body>
                <call expression="this.inventory.add(item)" expression-java="this.inventory.add(item)" enable="true"/>
            </body>
        </method>
        <method access="public" type="void" type-java="void" name="setMovingToTarget" enable="true">
            <javadoc xml:space="preserve"/>
            <params>
                <param type="boolean" type-java="boolean" name="movingToTarget"/>
            </params>
            <throws/>
            <body>
                <assign dest="this.movingToTarget" dest-java="this.movingToTarget" src="movingToTarget" src-java="movingToTarget" enable="true"/>
            </body>
        </method>
        <method access="public" type="int" type-java="int" name="getCredit" enable="true">
            <javadoc xml:space="preserve"/>
            <params/>
            <throws/>
            <body>
                <return value="this.credit" value-java="this.credit" enable="true"/>
            </body>
        </method>
        <method access="public" type="void" type-java="void" name="setCredit" enable="true">
            <javadoc xml:space="preserve"/>
            <params>
                <param type="int" type-java="int" name="credit"/>
            </params>
            <throws/>
            <body>
                <assign dest="this.credit" dest-java="this.credit" src="credit" src-java="credit" enable="true"/>
            </body>
        </method>
        <method access="public" type="ArrayList&lt;Item&gt;" type-java="ArrayList&lt;Item&gt;" name="getInventory" enable="true">
            <javadoc xml:space="preserve"/>
            <params/>
            <throws/>
            <body>
                <return value="this.inventory" value-java="this.inventory" enable="true"/>
            </body>
        </method>
    </methods>
</class>
