Ejemplo n.º 1
0
 public bool Check(Location locationToCheck)
 {
     if (myLocation == locationToCheck)
         return true;
     else
         return false;
 }
Ejemplo n.º 2
0
        public void Move()
        {
            if (myLocation is RoomWithDoor)
            {
                if (random.Next(2) == 1) // go through door?
                {
                    RoomWithDoor nextLocation = myLocation as RoomWithDoor;
                    myLocation = nextLocation.DoorLocation;
                }
            }

            do
            {
                myLocation = myLocation.Exits[random.Next(myLocation.Exits.Length)]; // go through a random exit
            } while (!(myLocation is IHidingPlace)); // repeat if no hiding place
        }
Ejemplo n.º 3
0
        //private Location currentLocation { get; set; }

        private void moveToANewLocation(Location newLocation)
        {
            Moves++;
            currentLocation = newLocation;
            redrawForm();

            //comboBoxExits.Items.Clear();
            //foreach (Location item in currentLocation.Exits)
            //{
            //    comboBoxExits.Items.Add(item.Name);
            //}
            //comboBoxExits.SelectedIndex = 0;

            //textBoxDescription.Text = currentLocation.Description;

            //if (currentLocation is IHasExteriorDoor)
            //    buttonGoThroughDoor.Visible = true;
            //else
            //    buttonGoThroughDoor.Visible = false;


        }
Ejemplo n.º 4
0
 public Opponent(Location myLocation)
 {
     this.myLocation = myLocation;
     random = new Random();
 }