private int mUpgradeSpeedLevel; // This is the current level of speed.

        #endregion Fields

        #region Constructors

        public StructureAttribute(ContentManager content, Structure structure)
            : base(content)
        {
            this.mStructure = structure;
            this.mContent = content;
            mDefenseLevel = 1;
            mAttackLevel = 1;
            SetStructureDefaultTarget();
        }
예제 #2
0
        public void InitializeStructurePool(ref Structure[][] StructurePool)
        {
            StructurePool = new Structure[8][];
            for (int i = 0; i < 8; i++)
            {
                StructurePool[i] = new Structure[5];
            }

            for (int objectType = 0; objectType < 8; objectType++)
            {
                for (int objectColor = 0; objectColor < 5; objectColor++)
                {
                    switch ((ObjectColor)objectColor)
                    {
                        case ObjectColor.BLUE:
                            StructurePool[objectType][objectColor] = new Structure((ObjectType)objectType, content,
                                                                          SpriteState.STRUCTURE, new Vector2(0, -3000),
                                                                          (ObjectColor)objectColor, UserInterfaceController.BlueStructureButton.Sprite.WorldPosition);
                            StructurePool[objectType][objectColor].Sprite.LoadContent();
                            break;
                        case ObjectColor.RED:
                            StructurePool[objectType][objectColor] = new Structure((ObjectType)objectType, content,
                                                                          SpriteState.STRUCTURE, new Vector2(0, -3000),
                                                                          (ObjectColor)objectColor, UserInterfaceController.RedStructureButton.Sprite.WorldPosition);
                            StructurePool[objectType][objectColor].Sprite.LoadContent();
                            break;
                        case ObjectColor.YELLOW:
                            StructurePool[objectType][objectColor] = new Structure((ObjectType)objectType, content,
                                                                          SpriteState.STRUCTURE, new Vector2(0, -3000),
                                                                          (ObjectColor)objectColor, UserInterfaceController.YellowStructureButton.Sprite.WorldPosition);
                            StructurePool[objectType][objectColor].Sprite.LoadContent();
                            break;
                        case ObjectColor.GREEN:
                            StructurePool[objectType][objectColor] = new Structure((ObjectType)objectType, content,
                                                                          SpriteState.STRUCTURE, new Vector2(0, -3000),
                                                                          (ObjectColor)objectColor, UserInterfaceController.GreenStructureButton.Sprite.WorldPosition);
                            StructurePool[objectType][objectColor].Sprite.LoadContent();
                            break;
                        case ObjectColor.PURPLE:
                            StructurePool[objectType][objectColor] = new Structure((ObjectType)objectType, content,
                                                                          SpriteState.STRUCTURE, new Vector2(0, -3000),
                                                                          (ObjectColor)objectColor, UserInterfaceController.PurpleStructureButton.Sprite.WorldPosition);
                            StructurePool[objectType][objectColor].Sprite.LoadContent();
                            break;
                        case ObjectColor.NULL:
                            break;
                        default:
                            break;
                    }

                }

            }
        }
예제 #3
0
        public void InitializeInPlayStructures(ref  Structure[] InPlayStructures)
        {
            InPlayStructures = new Structure[5];

            for (int i = 0; i < InPlayStructures.Length; i++)
            {
                InPlayStructures[i] = null;
            }
        }
        public static void PrintStructureAttributes(ref float textScale, ref TextBoxString gameObjectAttribute,
												ref List<TextBoxString> gameObjectAttributeList, ref string gameObjectAttributeString,
												 Structure tempStructure)
        {
            //Print Strucutre Name
            gameObjectAttributeString = tempStructure.StructureType.ToString();
            WriteLine(ref gameObjectAttribute, textScale, gameObjectAttributeString, gameObjectAttributeList);

            // Print Health
            gameObjectAttributeString = "Health: " + tempStructure.StructureAttribute.CurrentHealthPoints.ToString();
            WriteLine(ref gameObjectAttribute, textScale, gameObjectAttributeString, gameObjectAttributeList);

            // Print Armor
            gameObjectAttributeString = "Armor: " + tempStructure.StructureAttribute.CurrentArmor;
            WriteLine(ref gameObjectAttribute, textScale, gameObjectAttributeString, gameObjectAttributeList);

            gameObjectAttributeString = " ";
        }
        internal static void ListenForUpgrade()
        {
            for (int i = 0; i < StructureButtonGroup.ButtonList.Count; i++)
            {
                if (StructureButtonGroup.ButtonList[i].ButtonRectangle.Contains(mouseRectangle))
                {

                    if (StructureButtonGroup.ButtonList[i] == BlueStructureButton &&
                        BlueOccupationState == StructureOccupationState.OCCUPIED)
                    {
                        tempStructure = (Structure)GameObject.mInPlayObjectList.GetCurrent().gameObject;
                        HeroActionGroupState = HeroActionButtonGroupState.UPGRADE_ONE;
                        break;
                    }
                    if (StructureButtonGroup.ButtonList[i] == RedStructureButton &&
                        RedOccupationState == StructureOccupationState.OCCUPIED)
                    {
                        tempStructure = (Structure)GameObject.mInPlayObjectList.GetCurrent().gameObject;
                        HeroActionGroupState = HeroActionButtonGroupState.UPGRADE_TWO;
                        break;
                    }
                    if (StructureButtonGroup.ButtonList[i] == YellowStructureButton &&
                        YellowOccupationState == StructureOccupationState.OCCUPIED)
                    {
                        tempStructure = (Structure)GameObject.mInPlayObjectList.GetCurrent().gameObject;
                        HeroActionGroupState = HeroActionButtonGroupState.UPGRADE_THREE;
                        break;
                    }
                    if (StructureButtonGroup.ButtonList[i] == GreenStructureButton &&
                        GreenOccupationState == StructureOccupationState.OCCUPIED)
                    {
                        tempStructure = (Structure)GameObject.mInPlayObjectList.GetCurrent().gameObject;
                        HeroActionGroupState = HeroActionButtonGroupState.UPGRADE_FOUR;
                        break;
                    }
                    if (StructureButtonGroup.ButtonList[i] == PurpleStructureButton &&
                        PurpleOccupationState == StructureOccupationState.OCCUPIED)
                    {
                        tempStructure = (Structure)GameObject.mInPlayObjectList.GetCurrent().gameObject;
                        HeroActionGroupState = HeroActionButtonGroupState.UPGRADE_FIVE;
                        break;
                    }
                }
            }
        }