Ejemplo n.º 1
0
        public void AddState <TState>() where TState : State, new()
        {
            var type = typeof(TState);

            if (_states.ContainsKey(type))
            {
                throw new Exception("This state already exists.");
            }

            var state = new TState();

            state.SetStateMachine(this);
            _states.Add(type, state);
        }