public bool move(Directions dir) { if (currChamber.hasDoor(dir)) { switch (dir) { case Directions.North: currChamber = temple.getChamber(currChamber.getYPos() - 1, currChamber.getXPos()); break; case Directions.East: currChamber = temple.getChamber(currChamber.getYPos(), currChamber.getXPos() + 1); break; case Directions.South: currChamber = temple.getChamber(currChamber.getYPos() + 1, currChamber.getXPos()); break; case Directions.West: currChamber = temple.getChamber(currChamber.getYPos(), currChamber.getXPos() - 1); break; } return(true); } else { return(false); } }
public Hero(string name, int firepower, Temple temple) : base(name, firepower) { this.temple = temple; currChamber = temple.getChamber( GameManager.getRandom().Next(temple.getYChambers()), GameManager.getRandom().Next(temple.getXChambers()) ); }