Line | |
---|
1 | /* |
---|
2 | orxonox - the future of 3D-vertical-scrollers |
---|
3 | |
---|
4 | Copyright (C) 2004 orx |
---|
5 | |
---|
6 | This program is free software; you can redistribute it and/or modify |
---|
7 | it under the terms of the GNU General Public License as published by |
---|
8 | the Free Software Foundation; either version 2, or (at your option) |
---|
9 | any later version. |
---|
10 | |
---|
11 | ### File Specific: |
---|
12 | main-programmer: Thomas Fahrni |
---|
13 | co-programmer: |
---|
14 | */ |
---|
15 | |
---|
16 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_AI |
---|
17 | #include "ai_team_member.h" |
---|
18 | #include "movement_module.h" |
---|
19 | #include "ai_engine.h" |
---|
20 | #include "debug.h" |
---|
21 | |
---|
22 | |
---|
23 | AITeamMember::AITeamMember() |
---|
24 | {} |
---|
25 | |
---|
26 | AITeamMember::~AITeamMember() |
---|
27 | {} |
---|
28 | |
---|
29 | |
---|
30 | |
---|
31 | void AITeamMember::process() |
---|
32 | { |
---|
33 | int moduleCount=modules.size(); |
---|
34 | for(int i=0; i < moduleCount; i++ ) |
---|
35 | { |
---|
36 | //std::cout << "Processing AIModule " << i << " (" << moduleCount << ")\n"; |
---|
37 | modules.at(i)->process(); |
---|
38 | } |
---|
39 | } |
---|
40 | |
---|
41 | |
---|
42 | |
---|
43 | |
---|
44 | void AITeamMember::addToTeam(int aiTeamNumber) |
---|
45 | { |
---|
46 | //macht nicht so ganz das was es eigntlich machen sollte.. |
---|
47 | AIEngine* aiEngine=AIEngine::getInstance(); |
---|
48 | int teamNumber=aiEngine->newTeam(); |
---|
49 | aiEngine->getTeam(teamNumber)->addMember(this); |
---|
50 | |
---|
51 | MovementModule* nMod=new MovementModule; |
---|
52 | addModule(nMod); |
---|
53 | //nMod->testModule=nMod; |
---|
54 | } |
---|
55 | |
---|
56 | |
---|
57 | |
---|
58 | |
---|
59 | void AITeamMember::addModule(AIModule* newModule) |
---|
60 | { |
---|
61 | std::cout << "AIModule added\n"; |
---|
62 | modules.push_back(newModule); |
---|
63 | newModule->setOwner(this); |
---|
64 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.