コード例 #1
0
        public Structure(ObjectType mStructureType, ContentManager content,
                         SpriteState defaultState, Vector2 SpritePosition, ObjectColor mStructureColor, Vector2 ButtonPosition)
            : base(mStructureType, content, defaultState, SpritePosition, Hostility.STRUCTURE)
        {
            this.mStructureType = mStructureType;
            this.mStructureColor = mStructureColor;
            this.content = content;
            this.defaultState = defaultState;
            this.mSpritePosition = SpritePosition;
            this.mButtonPosition = ButtonPosition;

            mStructureAttribute = new StructureAttribute(content, this);
            SetAttributes();
            SetUnitAnimation();
        }
コード例 #2
0
        internal static void ListenFroMouseoverButtons()
        {
            if (HeroActionGroupState == HeroActionButtonGroupState.PURCHASE_PAGE_ONE)
            {
                for (int i = 0; i < PurchaseStructureButtonGroup.ButtonList.Count; i++)
                {
                    if (PurchaseStructureButtonGroup.ButtonList[i].ButtonRectangle.Contains(mouseRectangle))
                    {
                        if (PurchaseStructureButtonGroup.ButtonList[i] == PurchaseWolfpenButton)
                        {
                            purchaseStructureDrawState = PurhcaseStructureDrawState.ACTIVE;
                            tempStrucutreAttribute = GameController.StructurePool[6][0].StructureAttribute;
                            tempPurchaseString = "Wolf";
                        }
                        if (PurchaseStructureButtonGroup.ButtonList[i] == PurchaseBarracksButton)
                        {
                            purchaseStructureDrawState = PurhcaseStructureDrawState.ACTIVE;
                            tempStrucutreAttribute = GameController.StructurePool[5][0].StructureAttribute;
                            tempPurchaseString = "Berserker";
                        }
                        if (PurchaseStructureButtonGroup.ButtonList[i] == PurchaseArmoryButton)
                        {
                            purchaseStructureDrawState = PurhcaseStructureDrawState.ACTIVE;
                            tempStrucutreAttribute = GameController.StructurePool[4][0].StructureAttribute;
                            tempPurchaseString = "Axe Thrower";
                        }
                        if (PurchaseStructureButtonGroup.ButtonList[i] == PurchaseLibraryButton)
                        {
                            purchaseStructureDrawState = PurhcaseStructureDrawState.ACTIVE;
                            tempStrucutreAttribute = GameController.StructurePool[2][0].StructureAttribute;
                            tempPurchaseString = "Arcane Mage";
                        }
                        if (PurchaseStructureButtonGroup.ButtonList[i] == PurchaseAbbeyButton)
                        {
                            purchaseStructureDrawState = PurhcaseStructureDrawState.ACTIVE;
                            tempStrucutreAttribute = GameController.StructurePool[7][0].StructureAttribute;
                            tempPurchaseString = "Cleric";
                        }

                    }
                }
            }

            if (HeroActionGroupState == HeroActionButtonGroupState.PURCHASE_PAGE_TWO)
            {
                for (int i = 0; i < PurchaseStrctureButtonGroupPageTwo.ButtonList.Count; i++)
                {
                    if (PurchaseStructureButtonGroup.ButtonList[i].ButtonRectangle.Contains(mouseRectangle))
                    {
                        if (PurchaseStrctureButtonGroupPageTwo.ButtonList[i] == PurchaseBonePitButton)
                        {
                            purchaseStructureDrawState = PurhcaseStructureDrawState.ACTIVE;
                            tempStrucutreAttribute = GameController.StructurePool[1][0].StructureAttribute;
                            tempPurchaseString = "Necromancer";
                        }
                        if (PurchaseStrctureButtonGroupPageTwo.ButtonList[i] == PurchaseFireTempleButton)
                        {
                            purchaseStructureDrawState = PurhcaseStructureDrawState.ACTIVE;
                            tempStrucutreAttribute = GameController.StructurePool[3][0].StructureAttribute;
                            tempPurchaseString = "Fire Mage";
                        }
                        if (PurchaseStrctureButtonGroupPageTwo.ButtonList[i] == PurchaseDragonCaveButton)
                        {
                            purchaseStructureDrawState = PurhcaseStructureDrawState.ACTIVE;
                            tempStrucutreAttribute = GameController.StructurePool[0][0].StructureAttribute;
                            tempPurchaseString = "Dragon";
                        }
                    }
                }
            }
        }