Last change
on this file since 10108 was
10106,
checked in by smerkli, 10 years ago
|
Fixed the list problem, it was a circular include.
|
File size:
973 bytes
|
Line | |
---|
1 | // |
---|
2 | // Enemy.cc |
---|
3 | // Orxonox |
---|
4 | // |
---|
5 | // Created by Jonas Erb on 22.10.14. |
---|
6 | |
---|
7 | /** |
---|
8 | @brief |
---|
9 | See TowerDefenseReadme.txt for Information. |
---|
10 | |
---|
11 | @ingroup TowerDefense |
---|
12 | */ |
---|
13 | #include "Enemy.h" |
---|
14 | |
---|
15 | #include "core/CoreIncludes.h" |
---|
16 | //#include "core/XMLPort.h" |
---|
17 | |
---|
18 | namespace orxonox |
---|
19 | { |
---|
20 | RegisterClass(Enemy); |
---|
21 | |
---|
22 | /** |
---|
23 | @brief |
---|
24 | Constructor. Registers and initializes the object. |
---|
25 | */ |
---|
26 | Enemy::Enemy(Context* context) : Pawn(context) |
---|
27 | { |
---|
28 | RegisterObject(Enemy); |
---|
29 | |
---|
30 | this->setCollisionType(WorldEntity::Dynamic); |
---|
31 | |
---|
32 | } |
---|
33 | |
---|
34 | void Enemy::addWaypoint(TDCoordinate coord) |
---|
35 | { |
---|
36 | Waypointsvector_.push_back(coord); |
---|
37 | } |
---|
38 | |
---|
39 | void Enemy::popWaypoint() |
---|
40 | { |
---|
41 | if(Waypointsvector_.size()>0) |
---|
42 | Waypointsvector_.pop_back(); |
---|
43 | } |
---|
44 | |
---|
45 | TDCoordinate Enemy::peekWaypoint() |
---|
46 | { |
---|
47 | if(Waypointsvector_.size()<=0){ |
---|
48 | TDCoordinate coord = TDCoordinate(-1,-1); |
---|
49 | return coord; |
---|
50 | }else{ |
---|
51 | return Waypointsvector_.at(Waypointsvector_.size()-1); |
---|
52 | |
---|
53 | } |
---|
54 | |
---|
55 | |
---|
56 | } |
---|
57 | |
---|
58 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.