00001 #include "RakAssert.h" 00002 #include "State.h" 00003 00004 00005 00006 State::State() 00007 { 00008 fsmRefCount=0; 00009 } 00010 State::~State() 00011 { 00012 00013 } 00014 void State::OnEnter(const FSM *caller, bool loadResources) 00015 { 00016 00017 } 00018 void State::OnLeave(const FSM *caller, bool unloadResources) 00019 { 00020 00021 } 00022 void State::FSMAddRef(const FSM *caller) 00023 { 00024 ++fsmRefCount; 00025 } 00026 void State::FSMRemoveRef(const FSM *caller) 00027 { 00028 RakAssert(fsmRefCount!=0); 00029 --fsmRefCount; 00030 } 00031 unsigned State::FSMRefCount(void) const 00032 { 00033 return fsmRefCount; 00034 } 00035 void ManagedState::FSMRemoveRef(const FSM *caller) 00036 { 00037 RakAssert(fsmRefCount!=0); 00038 if (--fsmRefCount) 00039 delete this; 00040 }
1.7.1