Exemple #1
0
 public Building(Point positionInGrid, Player owner, string buildingName)
 {
     this.positionInGrid    = positionInGrid;
     this.owner             = owner;
     this.buildingName      = buildingName;
     turnsSeized            = 0;
     turnsBeforeRazeOnSeize = BuildingRegistry.GetRazeTime(buildingName);
     LoadTexture();
 }
Exemple #2
0
        private void LoadTexture()
        {
            StringBuilder textureName = new StringBuilder();

            textureName.Append("FE-Sprites/Buildings/");
            textureName.Append(BuildingRegistry.GetTextureName(buildingName));
            textureName.Append("@1x2");

            DrawingTexture = AssetManager.Instance.getAsset <Spritesheet>(textureName.ToString());
            DrawingTexture.SelectedSprite = new Point(0, owner.ColorName.ToLower().Equals("blue") ? 0 : 1);
        }
Exemple #3
0
        public override void PopulateBuildingActions(GuiList buildingActions)
        {
            // Get this building's trainees
            IList <string> trainees = BuildingRegistry.GetTrainees(BUILDING_ID);

            // Add a button for every trainee
            foreach (string trainee in trainees)
            {
                AddRecruitingButton(buildingActions, trainee + "." + Owner.soldierTiers[trainee]);
                if (Owner.soldierTiers[trainee] < 3)
                {
                    AddUpgradeButton(buildingActions, trainee, Owner.soldierTiers[trainee], Owner);
                }
            }

            // Add the basic building actions
            base.PopulateBuildingActions(buildingActions);
        }