Finished Gate class, except onEntry and onExit.
This commit is contained in:
parent
b8b79db028
commit
ab02de6e86
@ -2,46 +2,25 @@ package cicaprojekt;
|
||||
|
||||
public class Gate extends cicaprojekt.Tile
|
||||
{
|
||||
private boolean open;
|
||||
|
||||
private boolean open = false;
|
||||
|
||||
public void spawnStargate(cicaprojekt.Stargate stargate, Direction direction) {
|
||||
Menu.addTab();
|
||||
System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.spawnStargate(stargate," + direction.name() + ")");
|
||||
if(this.open)
|
||||
adjacentTile.get(direction).spawnStargate(stargate, direction);
|
||||
System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.spawnStargate()");
|
||||
Menu.removeTab();
|
||||
return;
|
||||
}
|
||||
|
||||
public void onEntry() {
|
||||
Menu.addTab();
|
||||
System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.onEntry()");
|
||||
System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.onEntry()");
|
||||
Menu.removeTab();
|
||||
}
|
||||
|
||||
public void onExit() {
|
||||
Menu.addTab();
|
||||
System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.onExit()");
|
||||
System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.onExit()");
|
||||
Menu.removeTab();
|
||||
}
|
||||
|
||||
public boolean isOpen() {
|
||||
Menu.addTab();
|
||||
System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.isOpen()");
|
||||
System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.isOpen()");
|
||||
Menu.removeTab();
|
||||
return open;
|
||||
}
|
||||
|
||||
|
||||
public void setOpen(boolean gateState) {
|
||||
Menu.addTab();
|
||||
System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.setOpen(" + gateState + ")");
|
||||
this.open = gateState;
|
||||
System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.setOpen()");
|
||||
Menu.removeTab();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user