Exemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="game"></param>
        public GameState(Game game)
            : base(game)
        {
            tag = this;

            childComponents = new List<GameComponent>();
            content = Game.Content;

            manager = (IStateManager)Game.Services.GetService(typeof(IStateManager));
        }
Exemplo n.º 2
0
        public void ChangeState(GameState state, PlayerIndex? index)
        {
            while (gameStates.Count > 0)
            {
                RemoveState();
            }

            drawOrder = StartDrawOrder;
            state.DrawOrder = drawOrder;
            drawOrder += DrawOrderInc;

            AddState(state, index);
            OnStateChanged();
        }
Exemplo n.º 3
0
 private void AddState(GameState state, PlayerIndex? index)
 {
     gameStates.Push(state);
     state.PlayerIndexInControl = index;
     Game.Components.Add(state);
     StateChanged += state.StateChanged;
 }
Exemplo n.º 4
0
 public void PushState(GameState state, PlayerIndex? index)
 {
     drawOrder += DrawOrderInc;
     AddState(state, index);
     OnStateChanged();
 }
Exemplo n.º 5
0
 public bool ContainsState(GameState state)
 {
     return gameStates.Contains(state);
 }