#include "AdeptHeaders.hpp" #include "State.hpp" //############################################################################# //########################### StateEngine ############################### //############################################################################# //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void StateEngine__FactoryRequest::ConstructFactoryRequest(Script *script) { Check_Pointer(this); Check_Object(script); // //---------------------------------- // Point into the notation file page //---------------------------------- // Page *page = script->instancePage; Check_Object(page); const char* engine_name = script->stateEngineName; Check_Pointer(engine_name); // //------------------------------------------------------------------------- // Find the initial state and look it up in the engine's class data. If it // doesn't exist, we got an error //------------------------------------------------------------------------- // const char* state; page->GetEntry(engine_name, &state, true); StateEngine::ClassData *class_data = script->engineClass; Check_Object(class_data); const StateEngine::StateEntry *entry = class_data->FindStateEntry(state); if (!entry) { STOP(( "%s: {[%s]%s=%s}: Unknown state!", page->GetNotationFile()->GetFileName(), page->GetName(), engine_name, state )); } // //------------------------------------------------------------------------- // Stuff the state number into both old and current state, then look to see // if a different old state is required //------------------------------------------------------------------------- // Check_Object(entry); currentState = entry->stateNumber; Verify(static_cast(currentState) < class_data->GetStateCount()); }