16 void CreateStableStates ()
21 m_Empty =
new HandStateEmpty(GetManOwner());
44 HandEventBase __Re_ =
new HandEventDestroyAndReplaceWithNewElsewhere;
45 HandEventBase __Rh_ =
new HandEventDestroyElsewhereAndReplaceWithNewInHands;
48 HandEventBase _fin_ =
new HandEventHumanCommandActionFinished;
52 HandReplacingItemInHands replacing =
new HandReplacingItemInHands(GetManOwner());
53 HandReplacingItemInHands replacingElsewhere =
new HandReplacingItemInHands(GetManOwner());
54 HandReplacingItemElsewhereWithNewInHands replacingElsewhere3 =
new HandReplacingItemElsewhereWithNewInHands(GetManOwner());
60 m_FSM.AddTransition(
new HandTransition(m_Equipped, __D__, m_Empty,
new HandActionDrop,
null));
61 m_FSM.AddTransition(
new HandTransition(m_Equipped, __Tw_, m_Empty,
new HandActionThrow,
null));
62 m_FSM.AddTransition(
new HandTransition(m_Equipped, __M__, m_Empty,
new HandActionMoveTo,
new HandGuardAnd(
new HandGuardHasItemInHands(GetManOwner()),
new HandGuardCanMove(GetManOwner()))));
63 m_FSM.AddTransition(
new HandTransition(m_Equipped, __X__, m_Empty,
new HandActionDestroy,
new HandGuardHasItemInHands(GetManOwner())));
64 m_FSM.AddTransition(
new HandTransition(m_Equipped, __Xd_, m_Empty,
new HandActionDestroyed,
new HandGuardHasDestroyedItemInHands(GetManOwner())));
65 m_FSM.AddTransition(
new HandTransition(m_Equipped, __Xd_, m_Equipped,
new HandActionDestroyed,
new HandGuardNot(
new HandGuardHasDestroyedItemInHands(GetManOwner()))));
67 m_FSM.AddTransition(
new HandTransition(m_Equipped, __R__, replacing));
68 m_FSM.AddTransition(
new HandTransition(replacing, _fin_, m_Equipped));
69 replacing.AddTransition(
new HandTransition(replacing.m_Replacing, _abt_, m_Equipped));
71 m_FSM.AddTransition(
new HandTransition(m_Equipped, __Re_, replacingElsewhere));
72 m_FSM.AddTransition(
new HandTransition(replacingElsewhere, _fin_, m_Empty));
73 replacingElsewhere.AddTransition(
new HandTransition(replacingElsewhere.m_Replacing, _abt_, m_Equipped));
75 m_FSM.AddTransition(
new HandTransition(m_Empty, __Rh_, replacingElsewhere3));
76 m_FSM.AddTransition(
new HandTransition(replacingElsewhere3, _fin_, m_Equipped));
77 replacingElsewhere3.AddTransition(
new HandTransition(replacingElsewhere3.m_Replacing, _abt_, m_Empty));
79 m_FSM.AddTransition(
new HandTransition(m_Equipped, __Rd_, m_Equipped,
new HandActionReplaced,
null));
80 m_FSM.AddTransition(
new HandTransition(m_Equipped, __W__, m_Equipped,
new HandActionSwap,
new HandGuardAnd(
new HandGuardHasItemInHands(GetManOwner()),
new HandGuardCanSwap(GetManOwner()))));
81 m_FSM.AddTransition(
new HandTransition(m_Equipped, __F__, m_Equipped,
new HandActionForceSwap,
new HandGuardAnd(
new HandGuardHasItemInHands(GetManOwner()),
new HandGuardCanForceSwap(GetManOwner()))));
84 m_FSM.SetInitialState(m_Empty);
90 bool CanProcessHandEvents () {
return m_FSM && m_FSM.IsRunning(); }
104 Debug.InventoryHFSMLog(
"STS = " + GetManOwner().GetSimulationTimeStamp() , e.ToString(),
"ProcessHandEvent", e.m_Player.ToString() );
120 m_FSM.ProcessAbortEvent(e, aa);
123 if (
LogManager.IsInventoryHFSMLogEnable())
hndDebugSpam(
"[hndfsm] STS = " + GetManOwner().GetSimulationTimeStamp() +
" Processed event e=" + e.ToString());
135 if ( !super.OnStoreLoad(ctx, version) )
146 super.OnStoreSave(ctx);
154 int GetCurrentStateID () {
return m_FSM.GetCurrentStateID(); }
156 bool IsIdle () {
return m_FSM.GetCurrentState().IsIdle(); }
161 void NetSyncCurrentStateID (
int id)
163 m_FSM.NetSyncCurrentStateID(
id);