Beispiel #1
0
        public void ChangeStateTo(ShipState shipState)
        {
            switch (shipState)
            {
            case ShipState.Born:
                m_ShipState = new ShipBornState(this, m_ShipState.m_Ship);
                break;

            case ShipState.Fly:
                m_ShipState = new ShipFlyState(this, m_ShipState.m_Ship);
                break;

            case ShipState.Surrond:
                m_ShipState = new ShipSurrondState(this, m_ShipState.m_Ship);
                break;

            case ShipState.Land:
                m_ShipState = new ShipLandState(this, m_ShipState.m_Ship);
                break;

            case ShipState.Hide:
                m_ShipState = new ShipHideState(this, m_ShipState.m_Ship);
                break;
            }
        }
Beispiel #2
0
 public StateManager(ShipElement ship)
 {
     m_ShipState = new ShipBornState(this, ship);
 }