Exemple #1
0
 public override void Update()
 {
     base.Update();
     // All move handles set back to LR move State
     //Debug.WriteLine("------");
     this.pMoveState = ShipMan.GetState(ShipMan.State.MoveLeftRight);
 }
        public static ShipState GetState(State state)
        {
            ShipMan pShipMan = ShipMan.PrivInstance();

            Debug.Assert(pShipMan != null);

            ShipState pShipState = null;

            switch (state)
            {
            case ShipMan.State.Ready:
                pShipState = pShipMan.pStateReady;
                break;

            case ShipMan.State.MissileFlying:
                pShipState = pShipMan.pStateMissileFlying;
                break;

            case ShipMan.State.End:
                pShipState = pShipMan.pStateEnd;
                break;

            default:
                Debug.Assert(false);
                break;
            }

            return(pShipState);
        }
        public static ShipState getShipState(ShipStateType shipStateType)
        {
            ShipManager shipMan = ShipManager.getSingleton();

            Debug.Assert(shipMan != null);

            ShipState shipSate = null;

            switch (shipStateType)
            {
            case ShipStateType.Ready:
                shipSate = shipMan.shipReadyState;
                break;

            case ShipStateType.MissileFlying:
                shipSate = shipMan.shipMissileFlyingState;
                break;

            case ShipStateType.End:
                shipSate = shipMan.shipEndState;
                break;

            case ShipStateType.Uninitilized:
                Debug.WriteLine("Uninitialiazed");
                break;

            default:
                Debug.WriteLine("Someth");
                break;
            }
            return(shipSate);
        }
Exemple #4
0
        public static ShipState GetState(ShipStateEnum shipState)
        {
            ShipManager shipMan    = ShipManager.GetInstance();
            ShipState   pShipState = null;

            switch (shipState)
            {
            case ShipStateEnum.Ready:
                pShipState = shipMan.pReadyState;
                break;

            case ShipStateEnum.MissileFlying:
                pShipState = shipMan.pMissileFlyingState;
                break;

            case ShipStateEnum.End:
                pShipState = shipMan.pEndState;
                break;

            default:
                Debug.Assert(false);
                break;
            }
            return(pShipState);
        }
 public CannonShip(GameObject.GameObjectName mGameObjectName, Sprite.SpriteName mSpriteName, int index, float mX, float mY) : base(mGameObjectName, index, mSpriteName)
 {
     this.x = mX;
     this.y = mY;
     //  this.cCollisionObj.cSpriteBox.setColor(Unit.spriteBoxColor);
     this.delta     = Unit.shipDeltaX;
     this.shipState = null;
     // hit = false;
 }
        public Ship(GameObject.Name name, GameSprite.Name spriteName, float posX, float posY)
            : base(name, spriteName, posX, posY)
        {
            this.x = posX;
            this.y = posY;

            this.shipSpeed = 3.0f;
            this.state     = null;
        }
Exemple #7
0
        public Ship(GameObject.Name name, GameSprite.Name spriteName, int index, float posX, float posY)
            : base(name, spriteName, index, ShipCategory.Type.Ship)
        {
            this.x = posX;
            this.y = posY;

            this.shipSpeed = 3.0f;
            this.state     = null;
        }
Exemple #8
0
 public Ship(GameObjectName goName, SpriteBaseName sName, float x, float y)
     : base(goName, sName, ShipType.Ship, 0)
 {
     this.x     = x;
     this.y     = y;
     this.state = null;
     this.speed = 5.0f;
     this.pProxySprite.pSprite.pColor = ColorFactory.Create(ColorName.Green).pAzulColor;
     this.pCollisionObject.pCollisionSpriteBox.pLineColor = ColorFactory.Create(ColorName.Blue).pAzulColor;
 }
Exemple #9
0
        public Ship(GameObject.Name name, GameSprite.Name spriteName, float posX, float posY, SndObserver pSndObs)
            : base(name, spriteName, ShipCategory.Type.Ship)
        {
            this.x = posX;
            this.y = posY;

            this.shipSpeed = 3.0f;
            this.state     = null;
            this.moveState = null;
            this.pSnd      = pSndObs;
        }
Exemple #10
0
 public ShipLeaf(GameSpriteName spname, float x, float y, int lx, int ly)
 {
     proxySprite  = new ProxySprite(spname, x, y);
     CollisionObj = new CollisionObject(proxySprite);
     PlayBatchMan.Find(BatchName.Box).Add(CollisionObj.Box);
     this.x    = x;
     this.y    = y;
     locationX = lx;
     locationY = ly;
     state     = new ShipReadyState();
 }
Exemple #11
0
        //----------------------------------------------------------------------------------
        // Constructor
        //----------------------------------------------------------------------------------
        public Ship(GameObject.Name name, GameSprite.Name spriteName, float posX, float posY)
            : base(name, spriteName, ShipCategory.Type.Ship)
        {
            this.x = posX;
            this.y = posY;

            this.shipSpeed = 3.0f;
            this.state     = null;

            this.pMoveState  = ShipMan.GetState(ShipMan.State.MoveLeftRight);
            this.pShootState = null;
        }
Exemple #12
0
        public static ShipState GetState(ShipMan.State state)
        {
            //ensure call Create() first
            ShipMan pShipMan = ShipMan.GetInstance();

            Debug.Assert(pShipMan != null);

            ShipState pShipState = null;

            switch (state)
            {
            case ShipMan.State.Ready:
                pShipState = pShipMan.pStateReady;
                break;

            case ShipMan.State.MissileFlying:
                pShipState = pShipMan.pStateMissileFlying;
                break;

            case ShipMan.State.End:
                pShipState = pShipMan.pStateEnd;
                break;

            case ShipMan.State.Normal:
                pShipState = pShipMan.pStateNormal;
                break;

            case ShipMan.State.MostLeft:
                pShipState = pShipMan.pStateMostLeft;
                break;

            case ShipMan.State.MostRight:
                pShipState = pShipMan.pStateMostRight;
                break;

            case ShipMan.State.Stay:
                pShipState = pShipMan.pStateStay;
                break;

            default:
                Debug.Assert(false);
                break;
            }

            return(pShipState);
        }
        public static ShipState GetState(State state)
        {
            ShipManager pShipMan = ShipManager.PrivInstance();

            Debug.Assert(pShipMan != null);

            ShipState pShipState = null;

            switch (state)
            {
            case ShipManager.State.Ready:
                pShipState = pShipMan.pStateReady;
                break;

            case ShipManager.State.MissileFlying:
                pShipState = pShipMan.pStateMissileFlying;
                break;

            case ShipManager.State.Dead:
                pShipState = pShipMan.pStateDead;
                break;

            case ShipManager.State.StopLeft:
                pShipState = pShipMan.pStateStopLeft;
                break;

            case ShipManager.State.StopRight:
                pShipState = pShipMan.pStateStopRight;
                break;

            case ShipManager.State.StopRightMissileFlying:
                pShipState = pShipMan.pStateStopRightMissileFlying;
                break;

            case ShipManager.State.StopLeftMissileFlying:
                pShipState = pShipMan.pStateStopLeftMissileFlying;
                break;

            default:
                Debug.Assert(false);
                break;
            }

            return(pShipState);
        }
Exemple #14
0
 public void SetMoveState(ShipMan.State inState)
 {
     this.moveState = ShipMan.GetState(inState);
 }
Exemple #15
0
 public void SetState(ShipMan.StateName stateName)
 {
     state          = ShipMan.GetState(stateName);
     this.stateName = stateName;
 }
Exemple #16
0
 public void SetState(ShipManager.State inState)
 {
     this.state = ShipManager.GetState(inState);
 }
Exemple #17
0
 public void SetState(ShipStateEnum shipState)
 {
     this.state = ShipManager.GetState(shipState);
 }
 public void SetState(ShipManager.State inState)
 {
     this.state            = ShipManager.GetState(inState);
     this.CurrentStateName = inState;
     //Debug.WriteLine(this.state);
 }
 public void setShipState(ShipManager.ShipStateType shipState)
 {
     this.shipState = ShipManager.getShipState(shipState);
 }
Exemple #20
0
 public void SetShootState(ShipMan.State inState)
 {
     this.pShootState = ShipMan.GetState(inState);
 }