Exemple #1
0
                public StateMachine(hkpackfileT.hksectionT.hkobjectT stateMachine, IDictionary <string, hkpackfileT.hksectionT.hkobjectT> dictObjects, IDictionary <hkpackfileT.hksectionT.hkobjectT, IEnumerable <State.Transition> > cTransitions)
                {
                    this.Raw = stateMachine;

                    var stateObjs = stateMachine.GetParamArray <string>("states").Select(stateObjName => dictObjects[stateObjName]);

                    states = stateObjs.Select(state => new State(state)).ToArray();                     // stateObjs.Select(stateObj => states[stateObj.GetParam<int>("stateId")]);

                    string wildcardTransitionsObjName = stateMachine.GetParam <string>("wildcardTransitions");

                    if (wildcardTransitionsObjName != null && wildcardTransitionsObjName != "null")
                    {
                        var wildcardTransitionObject = dictObjects[wildcardTransitionsObjName];

                        wildcardTransitions = cTransitions[wildcardTransitionObject].ToArray();

                        foreach (var transition in wildcardTransitions)
                        {
                            transition.targetState = GetStateById(transition.targetStateId);
                        }
                    }

                    foreach (var state in states)
                    {
                        state.ApplyTransitions(dictObjects, cTransitions);
                    }

                    foreach (var state in states)
                    {
                        state.ApplyTransitions2(this);
                    }
                }
Exemple #2
0
                    public State(hkpackfileT.hksectionT.hkobjectT obj)
                    {
                        Raw = obj;

                        StateId = obj.GetParam <int>("stateId");
                    }
Exemple #3
0
                        public Transition(hkpackfileT.hksectionT.hkobjectT trans)
                        {
                            Raw = trans;

                            targetStateId = trans.GetParam <int>("toStateId");
                        }