Esempio n. 1
0
        public void build()
        {
            for (int i = 0; i < player.cityArea.tiles.Length; i++)
            {
                if (!player.cityArea.tiles[i].isFilled)
                {
                    CityPiece cp = (cMList.Find(CityPiece => CityPiece.buildingType.Equals(comboBox1.Text)));
                    player.cityArea.tiles[i].overlayPicture = ResizeImage(Image.FromFile(cp.picture), 50, 50);
                    player.cityArea.tiles[i].isFilled       = true;
                    player.cityPiecesList.Add(cp);
                    player.resourceCubes[0] -= cp.cost[0];
                    player.resourceCubes[1] -= cp.cost[1];
                    player.resourceCubes[2] -= cp.cost[2];
                    player.resourceCubes[3] -= cp.cost[3];
                    string[] comboBoxItems = getPossibleBuildings(player.resourceCubes).ToArray();
                    comboBox1.Items.AddRange(comboBoxItems);
                    buildCount++;

                    if (buildCount >= maxBuildCount)
                    {
                        buildFormDone = true;
                        this.Close();
                    }
                    break;
                }
                else
                {
                    //do nothing
                }
            }
        }
Esempio n. 2
0
        public BuildForm(ref Player p, List <CityPiece> cityMasterList, bool godModeActivated, ref Player[] players)
        {
            InitializeComponent();
            player        = p;
            cMList        = cityMasterList;
            maxBuildCount = 1;


            pArray = players;
            if (player.culture != 'g')
            {
                this.Size = new Size(379, 165);
            }

            if (p.culture == 'e')
            {
                maxBuildCount = 3;
                getAllBuildings();
            }
            else if (p.culture == 'g')
            {
                maxBuildCount = 3;
                for (int i = 0; i < player.cityArea.tiles.Length; i++)
                {
                    if (!player.cityArea.tiles[i].isFilled)
                    {
                        CityPiece cp = (cMList.Find(CityPiece => CityPiece.buildingType.Equals("House")));
                        player.cityArea.tiles[i].overlayPicture = ResizeImage(Image.FromFile(cp.picture), 50, 50);
                        player.cityArea.tiles[i].isFilled       = true;
                        player.cityPiecesList.Add(cp);

                        break;
                    }
                }
            }
            else //n
            {
                maxBuildCount = 4;
            }
        }