public bool Check(Location location) { if (this.myLocation == location) return true; else return false; }
public void Move() { if (myLocation is IHasExteriorDoor) { IHasExteriorDoor LocationWithDoor = myLocation as IHasExteriorDoor; if (random.Next(2)==1) { myLocation = LocationWithDoor.DoorLocation; } } bool hiden = false; while (!hiden) { int rand = random.Next(myLocation.Exits.Length); myLocation = myLocation.Exits[rand]; if (myLocation is IHidingPlace) hiden = true; } }
public Opponent(Location startLocation) { this.myLocation = startLocation; random = new Random(); }