Exemple #1
0
        // Initializes the State.
        private void InitializeState(int stateID)
        {
            this.stateID = stateID;

            substates   = new SubstateCollection(this);
            transitions = new TransitionCollection(this);

            level = 1;
        }
Exemple #2
0
            /// <summary>
            /// Initializes a new instance of the State class with the specified
            /// number of events it will handle as well as its entry and exit
            /// actions.
            /// </summary>
            /// <param name="stateId">
            /// The State's ID.
            /// </param>
            /// <param name="entryHandler">
            /// The entry action.
            /// </param>
            /// <param name="exitHandler">
            /// The exit action.
            /// </param>
            public State(TState stateId, IEqualityComparer <TEvent> comparer = null)
            {
                HistoryType = HistoryType.None;

                ID = stateId;

                m_substates   = new SubstateCollection(this);
                m_transitions = new TransitionCollection(this, comparer);

                m_level = 1;
            }