Пример #1
0
        public void Initialize(RoseEntity entity, TStateEnum defaultState, TStateEnum initialState)
        {
            if (isInitialized)
            {
                return;
            }
            isInitialized = true;

            stateExecutors        = new Dictionary <TStateEnum, Action>();
            stateEnteredListeners = new Dictionary <TStateEnum, Action <TStateEnum> >();
            stateLeavedListeners  = new Dictionary <TStateEnum, Action <TStateEnum> >();
            stateUpdatedListeners = new Dictionary <TStateEnum, Action <TStateEnum> >();

            Entity       = entity;
            DefaultState = defaultState;
            InitialState = initialState;
            LastState    = DefaultState;
            CurrentState = initialState;
        }
Пример #2
0
 public void Initialize(RoseEntity entity, TStateEnum defaultState)
 {
     Initialize(entity, defaultState, defaultState);
 }