Example #1
0
 public bool Check(Location location)
 {
     if (location.Name == myLocation.Name)
         return true;
     else
         return false;
 }
Example #2
0
        public bool Check(Location location)
        {
            if (myLocation == location)
                return true;

            else
                return false;
        }
Example #3
0
 private void MoveToANewLocation(Location newLocation)
 {
     currentLocation = newLocation;
     comboBox1.Items.Clear();
     for (int i = 0; i < currentLocation.Exits.Length; i++)
         comboBox1.Items.Add(currentLocation.Exits[i].Name);
     comboBox1.SelectedIndex = 0;
     textBox1.Text = currentLocation.Description ;
     if (currentLocation is IHasExteriorDoor)
         button2.Visible = true;
     else
        button2.Visible = false;
 }
Example #4
0
        private void MoveToANewLocation(Location location)
        {
            currentLocation = location;
            comboBoxLocation.Items.Clear();

            foreach(Location l in currentLocation.Exits)
            {
                comboBoxLocation.Items.Add(l.Name);
            }
            comboBoxLocation.SelectedIndex = 0;
            textBoxDescription.Text = currentLocation.Description;
            buttonGoThroughDoor.Visible = (currentLocation is IHasExteriorDoor);
        }
Example #5
0
        private void MoveToANewLocation(Location newLocation)
        {
            this.currentLocation = newLocation;

            exits.Items.Clear();
            for (int i = 0; i < currentLocation.Exits.Length; i++)
                exits.Items.Add(currentLocation.Exits[i].Name);
            exits.SelectedIndex = 0;

            description.Text = currentLocation.Description;

            if (currentLocation is IHasExteriorDoor)
                goThroughTheDoor.Visible = true;
            else
                goThroughTheDoor.Visible = false;
        }
Example #6
0
        public void Move()
        {
            bool hidden = false;
            while (!hidden)
            {
                if (myLocation is IHasExteriorDoor)
                {
                    IHasExteriorDoor locationWithDoor = myLocation as IHasExteriorDoor;

                    if (random.Next(2) == 1)
                        myLocation = locationWithDoor.DoorLocation;
                }
                int rand = random.Next(myLocation.Exits.Length);
                myLocation = myLocation.Exits[rand];
                if (myLocation is IHidingPlace)
                    hidden = true;
            }
        }
Example #7
0
        public void Move()
        {
            bool hidden = false;

            while (!hidden)
            {
                if (myLocation is IHasExteriorDoor)
                {
                    if (random.Next(2) == 1)
                    {
                        IHasExteriorDoor nextLocation = myLocation as IHasExteriorDoor;
                        myLocation = nextLocation.DoorLocation;
                    }
                }

                myLocation = myLocation.Exits[random.Next(myLocation.Exits.Length)];
                if (myLocation is IHidingPlace)
                    hidden = true;
            }
        }
Example #8
0
        private void MoveToANewLocation(Location newLocation)
        {
            moves++;
            currentLocation = newLocation;

            RedrawForm();
        }
Example #9
0
 public Opponent(Location startingLocation)
 {
     myLocation = startingLocation;
     random = new Random();
 }