//--------------------------------------------------------------------- bool _initFsm(EbState state) { bool is_initstate = state._isInitState(); if (!is_initstate) { return(false); } state.enter(); mQueCurrentState.Add(state); var map_childstate = state._getMapChildState(); if (map_childstate.ContainsKey(0)) { var v = map_childstate[0]; foreach (var itc in v) { if (_initFsm(itc)) { return(true); } } } return(true); }
//--------------------------------------------------------------------- bool _isDirectLine(EbState parent, EbState child) { if (parent == child) { return(true); } Dictionary <int, List <EbState> > map_childstate = parent._getMapChildState(); if (map_childstate.ContainsKey(0)) { var v = map_childstate[0]; foreach (var itc in v) { if (_isDirectLine(itc, child)) { return(true); } } } return(false); }
//--------------------------------------------------------------------- void _enterState(EbState next_state) { next_state.enter(); mQueCurrentState.Add(next_state); var map_childstate = next_state._getMapChildState(); foreach (var i in map_childstate) { if (i.Value == null) { continue; } foreach (var s in i.Value) { if (s._isInitState()) { _enterState(s); break; } } } }