From f762f199cad05f227f794368e9b355e2f33e42f0 Mon Sep 17 00:00:00 2001 From: Lendemor Date: Sat, 4 Jun 2016 13:35:19 +0200 Subject: [PATCH] small changes in simulation --- src/dude.cpp | 2 +- src/dude.h | 2 +- src/simulation.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dude.cpp b/src/dude.cpp index d3aad47..94de427 100644 --- a/src/dude.cpp +++ b/src/dude.cpp @@ -2,7 +2,7 @@ #include "map.h" #include -Dude::Dude(const Coord &_pos, Map *_map, int &_team) : +Dude::Dude(const Coord &_pos, Map *_map, const int &_team) : m_pos(_pos), p_map(_map), m_team(_team), diff --git a/src/dude.h b/src/dude.h index d3cf802..8eaa6e7 100644 --- a/src/dude.h +++ b/src/dude.h @@ -20,7 +20,7 @@ private: int m_underResCount; public: - Dude(const Coord &_pos, Map *_map, int &_team); + Dude(const Coord &_pos, Map *_map, const int &_team); //general use functions void update(BehaviorFunction func); const Action& getAction() { return m_action; } diff --git a/src/simulation.cpp b/src/simulation.cpp index bc7b409..147194d 100644 --- a/src/simulation.cpp +++ b/src/simulation.cpp @@ -32,7 +32,7 @@ Simulation::~Simulation() void Simulation::update() { std::random_shuffle(m_dudes.begin(), m_dudes.end()); - for (int i=0; iisAlive()){ m_teams[dude->getTeam()].update(dude); //get action for this dude from behavior function in team @@ -43,7 +43,7 @@ void Simulation::update() resolveBattles(); // for each team, spawn dude if condition met - for(int i=0; i