Last change
on this file since 134 was
81,
checked in by rosiere, 16 years ago
|
- Finish Environment (and test)
- Continue predictor_unit
- Add external tools
- svn keyword "Id" set
|
-
Property svn:keywords set to
Id
|
File size:
867 bytes
|
Rev | Line | |
---|
[31] | 1 | /* |
---|
| 2 | * $Id: Component_find_entity.cpp 81 2008-04-15 18:40:01Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
[42] | 8 | #include "Behavioural/include/Component.h" |
---|
[31] | 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | |
---|
[75] | 13 | Entity * Component::find_entity (std::string name) |
---|
[31] | 14 | { |
---|
[43] | 15 | log_printf(FUNC,Behavioural,"Component::find_entity", "Begin"); |
---|
[31] | 16 | |
---|
[43] | 17 | Entity * _return = NULL; |
---|
| 18 | |
---|
[42] | 19 | if (_entity->get_name() == name) |
---|
[43] | 20 | _return = _entity; |
---|
[31] | 21 | else |
---|
| 22 | if (_list_component->empty()== false) |
---|
| 23 | { |
---|
[75] | 24 | std::list<Tcomponent_t *>::iterator i = _list_component->begin(); |
---|
[31] | 25 | |
---|
| 26 | while (i != _list_component->end()) |
---|
| 27 | { |
---|
[57] | 28 | Entity * entity = (*i)->_entity; |
---|
| 29 | |
---|
| 30 | if (entity->get_name() == name) |
---|
[31] | 31 | { |
---|
[57] | 32 | _return = entity; |
---|
[31] | 33 | break; |
---|
| 34 | } |
---|
| 35 | ++i; |
---|
| 36 | } |
---|
| 37 | } |
---|
| 38 | |
---|
[43] | 39 | log_printf(FUNC,Behavioural,"Component::find_entity", "End"); |
---|
| 40 | |
---|
| 41 | return _return; |
---|
[31] | 42 | }; |
---|
| 43 | |
---|
| 44 | }; // end namespace behavioural |
---|
| 45 | }; // end namespace morpheo |
---|
Note: See
TracBrowser
for help on using the repository browser.