1 |
pam-fi |
1.1 |
/* |
2 |
|
|
* SmartBlindCollection.cpp |
3 |
|
|
* |
4 |
|
|
* Created on: 16-mag-2009 |
5 |
|
|
* Author: Nicola Mori |
6 |
|
|
*/ |
7 |
|
|
|
8 |
|
|
/*! @file SmartCollection.cpp The SmartCollection class implementation file */ |
9 |
|
|
|
10 |
|
|
#include "SmartBlindCollection.h" |
11 |
|
|
|
12 |
|
|
void SmartBlindCollection::AddAction(CollectionAction& action) { |
13 |
|
|
_actions.push_back(&action); |
14 |
|
|
} |
15 |
|
|
|
16 |
|
|
CollectionAction *SmartBlindCollection::GetAction(unsigned int iAction) { |
17 |
|
|
if (_actions.size() == 0) |
18 |
|
|
return NULL; |
19 |
|
|
if (iAction < 0 || iAction > _actions.size() - 1) |
20 |
|
|
return NULL; |
21 |
|
|
else |
22 |
|
|
return _actions[iAction]; |
23 |
|
|
} |
24 |
|
|
|
25 |
|
|
void SmartBlindCollection::Setup(PamLevel2 *events){ |
26 |
|
|
BlindCutCollection::Setup(events); |
27 |
|
|
|
28 |
|
|
for (unsigned int i = 0; i < _actions.size(); i++){ |
29 |
|
|
_actions[i]->Setup(events); |
30 |
|
|
} |
31 |
|
|
} |
32 |
|
|
|
33 |
|
|
void SmartBlindCollection::Finalize(){ |
34 |
|
|
BlindCutCollection::Finalize(); |
35 |
|
|
|
36 |
|
|
for (unsigned int i = 0; i < _actions.size(); i++){ |
37 |
|
|
_actions[i]->Finalize(); |
38 |
|
|
} |
39 |
|
|
} |
40 |
|
|
|
41 |
|
|
void SmartBlindCollection::OnGood(PamLevel2 *event){ |
42 |
|
|
BlindCutCollection::OnGood(event); |
43 |
|
|
|
44 |
|
|
for (unsigned int i = 0; i < _actions.size(); i++){ |
45 |
|
|
_actions[i]->OnGood(event); |
46 |
|
|
} |
47 |
|
|
} |
48 |
|
|
|
49 |
|
|
void SmartBlindCollection::OnBad(PamLevel2 *event, int selectionResult){ |
50 |
|
|
BlindCutCollection::OnBad(event, selectionResult); |
51 |
|
|
|
52 |
|
|
for (unsigned int i = 0; i < _actions.size(); i++){ |
53 |
|
|
_actions[i]->OnBad(event, selectionResult); |
54 |
|
|
} |
55 |
|
|
} |