Exemple #1
0
 public bool Check(Location locationToCheck)
 {
     if (locationToCheck != myLocation)
         return false;
     else
         return true;
 }
Exemple #2
0
 public void Move()
 {
     if (myLocation is IHasExteriorDoor)
     {
         IHasExteriorDoor LocationWithDoor =
                             myLocation as IHasExteriorDoor;
         if (random.Next(2) == 1)
             myLocation = LocationWithDoor.DoorLocation;
     }
     bool hidden = false;
     while (!hidden)
     {
         int rand = random.Next(myLocation.Exits.Length);
         myLocation = myLocation.Exits[rand];
         if (myLocation is IHidingPlace)
             hidden = true;
     }
 }
Exemple #3
0
 public Opponent(Location startingLocation)
 {
     myLocation = startingLocation;
     random = new Random();
 }
Exemple #4
0
 private void MoveToANewLocation(Location newLocation)
 {
     Moves++;
     currentLocation = newLocation;
     RedrawForm();
 }