Rev | Line | |
---|
[10109] | 1 | // |
---|
| 2 | // TowerDefenseEnemy.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 "TowerDefenseEnemy.h" |
---|
| 14 | |
---|
| 15 | #include "core/CoreIncludes.h" |
---|
| 16 | //#include "core/XMLPort.h" |
---|
| 17 | |
---|
| 18 | namespace orxonox |
---|
| 19 | { |
---|
| 20 | RegisterClass(TowerDefenseEnemy); |
---|
| 21 | |
---|
| 22 | /** |
---|
| 23 | @brief |
---|
| 24 | Constructor. Registers and initializes the object. |
---|
| 25 | */ |
---|
| 26 | TowerDefenseEnemy::TowerDefenseEnemy(Context* context) : Pawn(context) |
---|
| 27 | { |
---|
| 28 | RegisterObject(TowerDefenseEnemy); |
---|
| 29 | |
---|
| 30 | this->setCollisionType(WorldEntity::Dynamic); |
---|
| 31 | |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | void TowerDefenseEnemy::addWaypoint(TDCoordinate coord) |
---|
| 35 | { |
---|
| 36 | orxout() << "test4" << endl; |
---|
| 37 | Waypointsvector_.push_back(coord); |
---|
| 38 | orxout() << "test5" << endl; |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | void TowerDefenseEnemy::popWaypoint() |
---|
| 42 | { |
---|
| 43 | if(Waypointsvector_.size()>0) |
---|
| 44 | Waypointsvector_.pop_back(); |
---|
| 45 | } |
---|
| 46 | |
---|
| 47 | TDCoordinate TowerDefenseEnemy::peekWaypoint() |
---|
| 48 | { |
---|
| 49 | if(Waypointsvector_.size()<=0){ |
---|
| 50 | TDCoordinate coord = TDCoordinate(-1,-1); |
---|
| 51 | return coord; |
---|
| 52 | }else{ |
---|
| 53 | return Waypointsvector_.at(Waypointsvector_.size()-1); |
---|
| 54 | |
---|
| 55 | } |
---|
| 56 | |
---|
| 57 | |
---|
| 58 | } |
---|
| 59 | |
---|
| 60 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.