00001 /* 00002 * SmartBlindCollection.cpp 00003 * 00004 * Created on: 16-mag-2009 00005 * Author: Nicola Mori 00006 */ 00007 00010 #include "SmartBlindCollection.h" 00011 00012 void SmartBlindCollection::AddAction(CollectionAction& action) { 00013 _actions.push_back(&action); 00014 } 00015 00016 CollectionAction *SmartBlindCollection::GetAction(unsigned int iAction) { 00017 if (_actions.size() == 0) 00018 return NULL; 00019 if (iAction < 0 || iAction > _actions.size() - 1) 00020 return NULL; 00021 else 00022 return _actions[iAction]; 00023 } 00024 00025 void SmartBlindCollection::Setup(PamLevel2 *events){ 00026 BlindCutCollection::Setup(events); 00027 00028 for (unsigned int i = 0; i < _actions.size(); i++){ 00029 _actions[i]->Setup(events); 00030 } 00031 } 00032 00033 void SmartBlindCollection::Finalize(){ 00034 BlindCutCollection::Finalize(); 00035 00036 for (unsigned int i = 0; i < _actions.size(); i++){ 00037 _actions[i]->Finalize(); 00038 } 00039 } 00040 00041 void SmartBlindCollection::OnGood(PamLevel2 *event){ 00042 BlindCutCollection::OnGood(event); 00043 00044 for (unsigned int i = 0; i < _actions.size(); i++){ 00045 _actions[i]->OnGood(event); 00046 } 00047 } 00048 00049 void SmartBlindCollection::OnBad(PamLevel2 *event, int selectionResult){ 00050 BlindCutCollection::OnBad(event, selectionResult); 00051 00052 for (unsigned int i = 0; i < _actions.size(); i++){ 00053 _actions[i]->OnBad(event, selectionResult); 00054 } 00055 }