Exemplo n.º 1
0
        public void SwitchLocation(Location location)
        {
            if (location == null || location == game.CurrentLocation)
            {
                return;
            }

            game.CurrentLocation = location;

            clearShopsInGui();
            addShopsInGuiForLocation(game.CurrentLocation);

            UpdateForm();
        }
Exemplo n.º 2
0
 public void Remove(Location location)
 {
     locations.Remove(location);
 }
Exemplo n.º 3
0
 public void Add(Location location)
 {
     locations.Add(location);
 }
Exemplo n.º 4
0
 public Player(string name, Location location, Money money)
     : this(name)
 {
     Location = location;
     this.money = money;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Adds the shops that are in the location to the GUI
 /// </summary>
 /// <param name="location">The location that contains the shops</param>
 private void addShopsInGuiForLocation(Location location)
 {
     foreach (Shop shop in location.Shops)
     {
         addShopInGui(shop);
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// Adds a location to the GUI
        /// </summary>
        /// <param name="location">The location you wish to add</param>
        private void addLocationInGui(Location location)
        {
            locationComboBox.Items.Add(location);

            locationToolStripMenuItem.DropDown.Items.Add(location.Name);
            locationToolStripMenuItem.DropDown.Items[locationToolStripMenuItem.DropDown.Items.Count - 1].Click += new EventHandler(locationItemsToolStripMenuItem_Click);
        }