1 | /* |
---|
2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
3 | * > www.orxonox.net < |
---|
4 | * |
---|
5 | * |
---|
6 | * License notice: |
---|
7 | * |
---|
8 | * This program is free software; you can redistribute it and/or |
---|
9 | * modify it under the terms of the GNU General Public License |
---|
10 | * as published by the Free Software Foundation; either version 2 |
---|
11 | * of the License, or (at your option) any later version. |
---|
12 | * |
---|
13 | * This program is distributed in the hope that it will be useful, |
---|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | * GNU General Public License for more details. |
---|
17 | * |
---|
18 | * You should have received a copy of the GNU General Public License |
---|
19 | * along with this program; if not, write to the Free Software |
---|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
21 | * |
---|
22 | * Author: |
---|
23 | * Mauro Salomon |
---|
24 | * Co-authors: |
---|
25 | * ... |
---|
26 | * |
---|
27 | */ |
---|
28 | |
---|
29 | #include "SpaceRaceManager.h" |
---|
30 | |
---|
31 | |
---|
32 | #include "core/XMLPort.h" |
---|
33 | |
---|
34 | #include "core/CoreIncludes.h" |
---|
35 | |
---|
36 | #include "util/Convert.h" |
---|
37 | #include "util/Math.h" |
---|
38 | |
---|
39 | namespace orxonox |
---|
40 | { |
---|
41 | CreateUnloadableFactory(SpaceRaceManager); |
---|
42 | |
---|
43 | SpaceRaceManager::SpaceRaceManager(BaseObject* creator) : BaseObject(creator) |
---|
44 | { |
---|
45 | RegisterObject(SpaceRaceManager); |
---|
46 | |
---|
47 | } |
---|
48 | |
---|
49 | SpaceRaceManager::~SpaceRaceManager() |
---|
50 | { |
---|
51 | if (this->isInitialized()) |
---|
52 | { |
---|
53 | for (size_t i = 0; i < this->checkpoints_.size(); ++i) |
---|
54 | this->checkpoints_[i]->destroy(); |
---|
55 | } |
---|
56 | } |
---|
57 | |
---|
58 | void SpaceRaceManager::addCheckpoint(RaceCheckPoint* checkpoint) |
---|
59 | { |
---|
60 | this->checkpoints_.push_back(checkpoint); |
---|
61 | } |
---|
62 | |
---|
63 | RaceCheckPoint* SpaceRaceManager::getCheckpoint(unsigned int index) const |
---|
64 | { |
---|
65 | if (index < this->checkpoints_.size()) |
---|
66 | return this->checkpoints_[index]; |
---|
67 | else |
---|
68 | return 0; |
---|
69 | } |
---|
70 | |
---|
71 | void SpaceRaceManager::XMLPort(Element& xmlelement, XMLPort::Mode mode) |
---|
72 | { |
---|
73 | SUPER(SpaceRaceManager, XMLPort, xmlelement, mode); |
---|
74 | |
---|
75 | //XMLPortParam(WaypointController, "accuracy", setAccuracy, getAccuracy, xmlelement, mode).defaultValues(100.0f); |
---|
76 | //XMLPortObject(WaypointController, WorldEntity, "waypoints", addWaypoint, getWaypoint, xmlelement, mode); |
---|
77 | } |
---|
78 | |
---|
79 | void SpaceRaceManager::tick(float dt) |
---|
80 | { |
---|
81 | SUPER(SpaceRaceManager,tick,dt); |
---|
82 | |
---|
83 | } |
---|
84 | |
---|
85 | |
---|
86 | |
---|
87 | |
---|
88 | |
---|
89 | |
---|
90 | } |
---|
91 | |
---|
92 | |
---|