Ejemplo n.º 1
0
        public Node(String name, bool movil, Shield.ShieldType shieldtype, Base.UControllerType basetype)
        {
            NodeAddress = 0x00; //TODO: Calcular
            Name        = name;
            Movil       = movil;
            if (movil)
            {
                CalculatePosition();
            }
            else
            {
                NodePosition = new Position()
                {
                    Floor = "", X = 0, Y = 0
                };
            }

            NodeShield = new Shield(shieldtype, basetype);
        }
Ejemplo n.º 2
0
        public Shield createShield(Shield.ShieldType mShieldType, GameObject.GameObjectName gameName, int index = 0, float mX = 0.0f, float mY = 0.0f)
        {
            Shield shield = null;

            switch (mShieldType)
            {
            case Shield.ShieldType.ShieldBrick:
                shield = new ShieldBrick(gameName, Sprite.SpriteName.ShieldBrick, index, mX, mY);
                break;

            case Shield.ShieldType.ShieldColumn:
                shield = new ShieldColumn(gameName, Sprite.SpriteName.NullObject, index, mX, mY);
                break;

            case Shield.ShieldType.ShieldUnit:
                shield = new ShieldUnit(gameName, Sprite.SpriteName.NullObject, index, mX, mY);
                break;

            case Shield.ShieldType.ShieldGrid:
                shield = new ShieldGrid(gameName, index, Sprite.SpriteName.NullObject);
                GameObjectNodeManager.add(shield, cPCSTree);
                break;

            case Shield.ShieldType.Uninitilized:
                Debug.WriteLine("Shield Type is Uninitilized");
                break;
            }

            this.cPCSTree.Insert(shield, this.cParent);
            // cSpriteBatch.addToBatch(shield.getProxySprite());
            // cSpriteBatch.addToBatch(shield.getCollisionObj().cSpriteBox);

            shield.addSpriteToBatch(this.cSpriteBatch);
            shield.addCollisionToBatch(SpriteBatchManager.find(SpriteBatch.SpriteBatchName.Boxes));
            return(shield);
        }