added method Tile.isSteppable() for obvious reasons...
This commit is contained in:
		@@ -11,6 +11,13 @@ public class Field extends cicaprojekt.Tile {
 | 
			
		||||
        super();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public boolean isSteppable() {
 | 
			
		||||
        if (boxStack.isEmpty())
 | 
			
		||||
            return true;
 | 
			
		||||
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void spawnStargate(cicaprojekt.Stargate stargate, Direction direction) {
 | 
			
		||||
 
 | 
			
		||||
@@ -5,6 +5,12 @@ public class Gap extends cicaprojekt.Tile {
 | 
			
		||||
        super();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public boolean isSteppable()
 | 
			
		||||
    {
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void spawnStargate(cicaprojekt.Stargate stargate, Direction direction) {
 | 
			
		||||
        adjacentTile.get(direction).spawnStargate(stargate, direction);
 | 
			
		||||
 
 | 
			
		||||
@@ -24,6 +24,15 @@ public class Gate extends Tile {
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public boolean isSteppable()
 | 
			
		||||
    {
 | 
			
		||||
        if (open)
 | 
			
		||||
            return true;
 | 
			
		||||
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public boolean isOpen() {
 | 
			
		||||
        return open;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -32,12 +32,15 @@ public class PlayerBase implements Destroyable {
 | 
			
		||||
 | 
			
		||||
    public void move(Direction direction) {
 | 
			
		||||
        this.setFacingDirection(direction);
 | 
			
		||||
        Tile tile = this.getCurrentTile().getAdjacentTile(direction);
 | 
			
		||||
        Tile adjtile = this.getCurrentTile().getAdjacentTile(direction);
 | 
			
		||||
 | 
			
		||||
        if (tile != null)
 | 
			
		||||
        if (adjtile != null)
 | 
			
		||||
        {
 | 
			
		||||
            tile.onEntry(this);
 | 
			
		||||
            setCurrentTile(tile);
 | 
			
		||||
            if (adjtile.isSteppable())
 | 
			
		||||
            {
 | 
			
		||||
                adjtile.onEntry(this);
 | 
			
		||||
                setCurrentTile(adjtile);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -14,6 +14,15 @@ public class Scale extends Field {
 | 
			
		||||
        boxStack = new Stack<Box>();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public boolean isSteppable()
 | 
			
		||||
    {
 | 
			
		||||
        if (boxStack.isEmpty())
 | 
			
		||||
            return true;
 | 
			
		||||
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onEntry(PlayerBase playerBase) {
 | 
			
		||||
        gateConnected.setOpen(true);
 | 
			
		||||
 
 | 
			
		||||
@@ -31,6 +31,8 @@ public abstract class Tile {
 | 
			
		||||
            this.y = y;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public abstract boolean isSteppable();
 | 
			
		||||
 | 
			
		||||
    public Tile getAdjacentTile(Direction direction) {
 | 
			
		||||
        return adjacentTile.get(direction);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -18,6 +18,14 @@ public class Wall extends Tile {
 | 
			
		||||
            return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public boolean isSteppable() {
 | 
			
		||||
        if (sg != null)
 | 
			
		||||
            return true;
 | 
			
		||||
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void clearStargate() {
 | 
			
		||||
        if(sg != null) {
 | 
			
		||||
            sg.setCurrentWall(null);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user