Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

PunctualAction.cpp

00001 // 00002 // Copyright 2004 P&P Software GmbH - All Rights Reserved 00003 // 00004 // PunctualAction.cpp 00005 // 00006 // Version 1.0 00007 // Date 01.10.02 00008 // Author A. Pasetti (P&P Software) 00009 00010 #include "../GeneralInclude/CompilerSwitches.h" 00011 #include "../GeneralInclude/Constants.h" 00012 #include "../Base/CC_RootObject.h" 00013 #include "PunctualAction.h" 00014 00015 PunctualAction::PunctualAction(void) { 00016 enabledStatus = ENABLED; 00017 lastOutcome = ACTION_RESET; 00018 } 00019 00020 TD_ActionOutcome PunctualAction::execute(void) { 00021 TD_ActionOutcome outcomeCode = ACTION_DISABLED; 00022 00023 if ( isEnabled() ) { 00024 outcomeCode = doAction(); 00025 CC_RootObject::getEventRepository()->create(this, EVT_PUNCTUAL_ACTION_EXEC ); 00026 } else 00027 CC_RootObject::getEventRepository()->create(this, EVT_PUNCTUAL_ACTION_DIS ); 00028 00029 lastOutcome = outcomeCode; 00030 return outcomeCode; 00031 } 00032 00033 void PunctualAction::setEnabled(bool isEnabled) { 00034 enabledStatus = isEnabled; 00035 } 00036 00037 bool PunctualAction::isEnabled(void) const { 00038 return enabledStatus; 00039 } 00040 00041 TD_ActionOutcome PunctualAction::getLastOutcome(void) const { 00042 return lastOutcome; 00043 } 00044 00045 void PunctualAction::resetLastOutcome(void) { 00046 lastOutcome = ACTION_RESET; 00047 }
Copyright 2003 P&P Software GmbH - All Rights Reserved