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
|
Line | |
---|
1 | /* |
---|
2 | * $Id: Component_find_entity.cpp 81 2008-04-15 18:40:01Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/include/Component.h" |
---|
9 | |
---|
10 | namespace morpheo { |
---|
11 | namespace behavioural { |
---|
12 | |
---|
13 | Entity * Component::find_entity (std::string name) |
---|
14 | { |
---|
15 | log_printf(FUNC,Behavioural,"Component::find_entity", "Begin"); |
---|
16 | |
---|
17 | Entity * _return = NULL; |
---|
18 | |
---|
19 | if (_entity->get_name() == name) |
---|
20 | _return = _entity; |
---|
21 | else |
---|
22 | if (_list_component->empty()== false) |
---|
23 | { |
---|
24 | std::list<Tcomponent_t *>::iterator i = _list_component->begin(); |
---|
25 | |
---|
26 | while (i != _list_component->end()) |
---|
27 | { |
---|
28 | Entity * entity = (*i)->_entity; |
---|
29 | |
---|
30 | if (entity->get_name() == name) |
---|
31 | { |
---|
32 | _return = entity; |
---|
33 | break; |
---|
34 | } |
---|
35 | ++i; |
---|
36 | } |
---|
37 | } |
---|
38 | |
---|
39 | log_printf(FUNC,Behavioural,"Component::find_entity", "End"); |
---|
40 | |
---|
41 | return _return; |
---|
42 | }; |
---|
43 | |
---|
44 | }; // end namespace behavioural |
---|
45 | }; // end namespace morpheo |
---|
Note: See
TracBrowser
for help on using the repository browser.