Changeset 11043
- Timestamp:
- Jan 4, 2016, 8:59:19 PM (9 years ago)
- Location:
- code/branches/presentationHS15/src/modules/hover
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentationHS15/src/modules/hover/FlagHUD.cc
r11041 r11043 88 88 SUPER(FlagHUD, tick, dt); 89 89 90 setFlagCount(this->hoverGame_->get Flags());90 setFlagCount(this->hoverGame_->getNumberOfFlags()); 91 91 } 92 92 -
code/branches/presentationHS15/src/modules/hover/Hover.cc
r11042 r11043 49 49 50 50 this->origin_ = NULL; 51 this-> flags_ = 1;51 this->numberOfFlags_ = 1; 52 52 this->firstTick_ = true; 53 53 … … 99 99 HoverFlag* flag = new HoverFlag(origin_->getContext()); 100 100 flag->init(rand()%numCells, rand()%numCells, cellSize); 101 flag Vector_.push_back(flag);101 flags_.push_back(flag); 102 102 } 103 104 flags_ = flagVector_.size();105 103 106 104 }//firsttick end 107 105 108 106 // Check if ship collided with one of the flags 109 for ( unsigned int i = 0; i < flag Vector_.size(); i++ ){110 if(flag Vector_[i]->getCollided()){111 flag Vector_[i]->destroyLater();112 flag Vector_.erase (flagVector_.begin()+i);107 for ( unsigned int i = 0; i < flags_.size(); i++ ){ 108 if(flags_[i]->getCollided()){ 109 flags_[i]->destroyLater(); 110 flags_.erase (flags_.begin()+i); 113 111 } 114 112 } 115 flags_ = flagVector_.size();113 numberOfFlags_ = flags_.size(); 116 114 } 117 115 } -
code/branches/presentationHS15/src/modules/hover/Hover.h
r11041 r11043 55 55 { this->origin_ = origin; } 56 56 57 inline int get Flags() const58 { return this-> flags_; }57 inline int getNumberOfFlags() const 58 { return this->numberOfFlags_; } 59 59 60 60 private: 61 61 WeakPtr<HoverOrigin> origin_; 62 std::vector<HoverFlag*> flag Vector_;63 int flags_;62 std::vector<HoverFlag*> flags_; 63 int numberOfFlags_; 64 64 bool firstTick_; 65 65 }; -
code/branches/presentationHS15/src/modules/hover/HoverFlag.cc
r11042 r11043 60 60 /** 61 61 @brief 62 Destructor. 63 */ 64 HoverFlag::~HoverFlag() 65 { 66 if (this->isInitialized()) 67 { 68 if (this->model_) 69 this->model_->destroy(); 70 if (this->cs_) 71 this->cs_->destroy(); 72 } 73 } 74 75 /** 76 @brief 62 77 Initializes the flag. 63 78 @param xCoordinate … … 84 99 /** 85 100 @brief 86 Destructor.87 */88 HoverFlag::~HoverFlag()89 {90 91 }92 93 /**94 @brief95 101 Checks if the Hovership collided with the flag 96 102 */ -
code/branches/presentationHS15/src/modules/hover/HoverWall.cc
r11042 r11043 60 60 HoverWall::~HoverWall() 61 61 { 62 62 if (this->isInitialized()) 63 { 64 if (this->model_) 65 this->model_->destroy(); 66 if (this->cs_) 67 this->cs_->destroy(); 68 } 63 69 } 64 70 -
code/branches/presentationHS15/src/modules/hover/MazeGenerator.cc
r11040 r11043 84 84 } 85 85 86 MazeGenerator::~MazeGenerator() 87 { 88 delete[] this->levelcode_; 89 delete[] this->maze_; 90 } 91 86 92 /** 87 93 @brief -
code/branches/presentationHS15/src/modules/hover/MazeGenerator.h
r11040 r11043 52 52 public: 53 53 MazeGenerator(int numCells); 54 ~MazeGenerator(); 54 55 55 56 void generateMaze(); -
code/branches/presentationHS15/src/modules/hover/TimeHUD.cc
r11041 r11043 83 83 this->setCaption(getTimeString(this->time_)); 84 84 } 85 if(this->hoverGame_->get Flags() == 0)85 if(this->hoverGame_->getNumberOfFlags() == 0) 86 86 setRunning(false); 87 87
Note: See TracChangeset
for help on using the changeset viewer.