public static ShipShootState GetShootState(ShootState state) { ShipManager pShipMan = ShipManager.PrivInstance(); Debug.Assert(pShipMan != null); ShipShootState pShipShootState = null; switch (state) { case ShipManager.ShootState.MissileReady: pShipShootState = pShipMan.pMissileReadyState; break; case ShipManager.ShootState.MissileFlying: pShipShootState = pShipMan.pMissileFlyingState; break; case ShipManager.ShootState.Locked: pShipShootState = pShipMan.pMissileLockedState; break; } return(pShipShootState); }
public static ShipShootState GetShootState(ShootState state) { ShipMan pShipMan = ShipMan.PrivInstance(); Debug.Assert(pShipMan != null); ShipShootState pShipState = null; switch (state) { case ShipMan.ShootState.Ready: pShipState = pShipMan.pStateReady; break; case ShipMan.ShootState.MissileFlying: pShipState = pShipMan.pStateMissileFlying; break; case ShipMan.ShootState.End: pShipState = pShipMan.pStateEnd; break; default: Debug.Assert(false); break; } return(pShipState); }
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 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; }
// tells ship what state it should be in.... //can it Shoot? can it move L or R? public void SetShootState(ShipMan.ShootState inState) { this.state = ShipMan.GetShootState(inState); }
public void SetShootState(ShipManager.ShootState inState) { this.pShootState = ShipManager.GetShootState(inState); }