public static MoveShipState GetMoveState(MoveState state) { ShipMan pShipMan = ShipMan.PrivInstance(); Debug.Assert(pShipMan != null); MoveShipState pMoveState = null; switch (state) { case ShipMan.MoveState.NoLeft: pMoveState = pShipMan.pNoLeftState; break; case ShipMan.MoveState.FreeMove: pMoveState = pShipMan.pFreeMoveState; break; case ShipMan.MoveState.NoRight: pMoveState = pShipMan.pNoRightState; break; case ShipMan.MoveState.NoMove: pMoveState = pShipMan.pNoMoveState; break; default: Debug.Assert(false); break; } return(pMoveState); }
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.moveState = null; }
public void SetMoveState(ShipMan.MoveState inState) { this.moveState = ShipMan.GetMoveState(inState); }