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

            else
                return false;
        }
示例#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;
 }
示例#4
0
文件: Form1.cs 项目: ppaier/HFCSharp
        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);
        }
示例#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;
        }
示例#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;
            }
        }
示例#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;
            }
        }
示例#8
0
        private void MoveToANewLocation(Location newLocation)
        {
            moves++;
            currentLocation = newLocation;

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