public static ShipMotionState GetMotionState(MotionState state) { ShipManager pShipMan = ShipManager.PrivInstance(); Debug.Assert(pShipMan != null); ShipMotionState pShipMotionState = null; switch (state) { case ShipManager.MotionState.Free: pShipMotionState = pShipMan.pFreeMotionState; break; case ShipManager.MotionState.LeftOnly: pShipMotionState = pShipMan.pLeftMotionOnlyState; break; case ShipManager.MotionState.RightOnly: pShipMotionState = pShipMan.pRightMotionOnlyState; break; case ShipManager.MotionState.Locked: pShipMotionState = pShipMan.pMotionLockedState; break; } return(pShipMotionState); }
public Ship(GameObject.Name name, Sprite.Name spriteName, BoxSprite.Name boxSpriteName, float posX, float posY) : base(name, spriteName, boxSpriteName) { this.x = posX; this.y = posY; this.speedX = 5.0f; this.pMotionState = null; this.pShootState = null; }
public void SetMotionState(ShipManager.MotionState inState) { this.pMotionState = ShipManager.GetMotionState(inState); }