[Orxonox-commit 7803] r12395 - code/branches/OrxoBlox_FS19/src/modules/OrxoBlox
pomselj at orxonox.net
pomselj at orxonox.net
Thu May 16 19:16:49 CEST 2019
Author: pomselj
Date: 2019-05-16 19:16:49 +0200 (Thu, 16 May 2019)
New Revision: 12395
Modified:
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.cc
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.h
Log:
kinda done
Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc 2019-05-16 16:27:53 UTC (rev 12394)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc 2019-05-16 17:16:49 UTC (rev 12395)
@@ -111,17 +111,19 @@
this->futureWall_ = nullptr;
}
*/
+
+ for (OrxoBloxStones* stone : ObjectList<OrxoBloxStones>()) {
+ if(stone != nullptr)
+ stone->destroy();
+ }
+
+
for (OrxoBloxWall* wall : this->activeWalls_) {
if (wall != nullptr)
wall->destroy();
}
this->activeWalls_.clear();
-
- for (OrxoBloxStones* stone : this->stones_) {
- if(stone != nullptr)
- stone->destroy();
- }
this->stones_.clear();
if(this->playership != nullptr) {
this->playership->destroy();
@@ -188,7 +190,7 @@
// Call end for the parent class.
Deathmatch::end();
- GSLevel::startMainMenu();
+ //GSLevel::startMainMenu();
}
PlayerInfo* OrxoBlox::getPlayer()
@@ -213,13 +215,13 @@
int z_ = 0;
orxout() << "level up called" << endl;
- //this->playerScored(this->player_);// add points
+ this->playerScored(this->player_);// add points
this->createWall();
this->activeWalls_.push_back(this->futureWall_);
-/* for (int i = 0; i < this->futureWall_->getNumberOfStones(); i++) {
+ for (int i = 0; i < this->futureWall_->getNumberOfStones(); i++) {
this->stones_.push_back(this->futureWall_->getStone(i));
- }*/
+ }
for(OrxoBloxWall* wall : this->activeWalls_) {
if(wall == nullptr) {
@@ -243,8 +245,8 @@
//new amount of balls
//create balls
//insert new wall
- for(OrxoBloxStones* stone : this->stones_){
- if (stone != nullptr) {
+ for(OrxoBloxStones* stone : ObjectList<OrxoBloxStones>()){
+ if (stone->isA(Class(OrxoBloxStones))) {
int x_=(stone->getPosition()).x;
int y_=(stone->getPosition()).y;
z_=(stone->getPosition()).z;
@@ -256,6 +258,9 @@
this->end();
}
}
+ else {
+ stone = nullptr;
+ }
}
@@ -340,14 +345,11 @@
}
*/
void OrxoBlox::count() {
- if(this->counter >= this->max_counter) {
+ if(++(this->counter) >= this->max_counter) {
this->LevelUp();
counter = 0;
return;
}
- else {
- this->counter++;
- }
}
Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h 2019-05-16 16:27:53 UTC (rev 12394)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h 2019-05-16 17:16:49 UTC (rev 12395)
@@ -110,7 +110,7 @@
std::vector<OrxoBloxWall*> activeWalls_;
std::vector<OrxoBloxStones*> stones_; //!< A list of all stones in play.
int counter;
- const int max_counter = 10;
+ const int max_counter = 4;
};
}
Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.cc 2019-05-16 16:27:53 UTC (rev 12394)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.cc 2019-05-16 17:16:49 UTC (rev 12395)
@@ -60,10 +60,8 @@
}
- this->num_Stones_ = TotalStones_.size();
-
// OrxoBloxStones* stone = new OrxoBloxStones(this->getContext());
// if(this->orxoblox_ != nullptr)
// {
@@ -96,7 +94,7 @@
}
int OrxoBloxWall::getNumberOfStones() {
- return num_Stones_;
+ return TotalStones_.size();
}
void OrxoBloxWall::setNumberOfStones(int number) {
Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.h
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.h 2019-05-16 16:27:53 UTC (rev 12394)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.h 2019-05-16 17:16:49 UTC (rev 12395)
@@ -45,13 +45,13 @@
bool isEmpty();
void reduceNumberOfStones();
void setNumberOfStones(int number);
+ std::vector<OrxoBloxStones*> TotalStones_;
private:
void createWall(void);
OrxoBlox* getOrxoBlox();
unsigned int totalhealth_;
unsigned int num_Stones_;
- unsigned int size_;
- std::vector<OrxoBloxStones*> TotalStones_; //!< A list of all stones in a Wall.
+ unsigned int size_; //!< A list of all stones in a Wall.
bool delay_;
OrxoBlox* orxoblox_;
WeakPtr<OrxoBloxCenterpoint> center_; //!< The playing field.
More information about the Orxonox-commit
mailing list