Ejemplo n.º 1
0
 public BandUList(Game game, SpriteBatch sB, Camera2D cam, Texture2D image, Vector2 pos, Building.BuildingList bL)
 {
     this.spriteBatch = sB;
     this.cam = cam;
     structPos = pos;
     bPos = structPos;
     structImg = image;
     bList = bL;
     UpgradeImage = game.Content.Load<Texture2D>("Upgrade");
     BuildImage = game.Content.Load<Texture2D>("Build");
     initialBuild = new BuildandUpgrade(sB, cam, BuildImage, pos);
     initialUpgrade = new BuildandUpgrade(sB, cam, UpgradeImage, pos);
 }
Ejemplo n.º 2
0
        private void UpdateBarracks(Vector2 updatedPos)
        {
            structPos = new Vector2(updatedPos.X + structImg.Width + 10,
                                    updatedPos.Y - 20);
            Vector2 uPos = structPos;

            //Build Menu
            initialBuild.Position = structPos;
            if (build == null)
            {
                build = new List<BuildandUpgrade>();
                build.Add(initialBuild);
                BuildandUpgrade testB = new BuildandUpgrade(spriteBatch, cam, BuildImage, structPos);

                testB.Position = NextPosition(build);
                build.Add(testB);
            }

            else
            {
                foreach (BuildandUpgrade p in build)
                {
                    p.Update(structPos);
                }
            }
            //Upgrade Menu
            uPos = new Vector2(updatedPos.X + structImg.Width + 10,
                               updatedPos.Y + 40);
            initialUpgrade.Position = uPos;
            if (upgrade == null)
            {
                upgrade = new List<BuildandUpgrade>();
                upgrade.Add(initialUpgrade);
            }

            else
            {
                foreach (BuildandUpgrade u in upgrade)
                {
                    u.Update(structPos);
                }
            }
        }