Get rid of two more member values
This commit is contained in:
parent
b5345c8b31
commit
748051871c
@ -114,8 +114,6 @@ void SoccerWorld::reset()
|
||||
}
|
||||
else WorldStatus::setClockMode(CLOCK_CHRONO);
|
||||
|
||||
m_red_goal = 0;
|
||||
m_blue_goal = 0;
|
||||
m_red_scorers.clear();
|
||||
m_red_score_times.clear();
|
||||
m_blue_scorers.clear();
|
||||
@ -194,10 +192,6 @@ void SoccerWorld::onCheckGoalTriggered(bool first_goal)
|
||||
if (isRaceOver() || isStartPhase())
|
||||
return;
|
||||
|
||||
// Notice: true first_goal means it's blue goal being shoot,
|
||||
// so red team can score
|
||||
(first_goal ? m_red_goal++ : m_blue_goal++);
|
||||
|
||||
setPhase(WorldStatus::GOAL_PHASE);
|
||||
m_goal_sound->play();
|
||||
if (m_ball_hitter != -1)
|
||||
@ -220,6 +214,8 @@ void SoccerWorld::onCheckGoalTriggered(bool first_goal)
|
||||
|
||||
if (first_goal)
|
||||
{
|
||||
// Notice: true first_goal means it's blue goal being shoot,
|
||||
// so red team can score
|
||||
m_red_scorers.push_back(sd);
|
||||
if (race_manager->hasTimeTarget())
|
||||
{
|
||||
|
@ -262,8 +262,6 @@ private:
|
||||
int m_ball_hitter;
|
||||
|
||||
/** Goals data of each team scored */
|
||||
int m_red_goal;
|
||||
int m_blue_goal;
|
||||
std::vector<ScorerData> m_red_scorers;
|
||||
std::vector<float> m_red_score_times;
|
||||
std::vector<ScorerData> m_blue_scorers;
|
||||
@ -331,7 +329,10 @@ public:
|
||||
SoccerTeam getKartTeam(unsigned int kart_id) const;
|
||||
// ------------------------------------------------------------------------
|
||||
int getScore(SoccerTeam team) const
|
||||
{ return (team == SOCCER_TEAM_BLUE ? m_blue_goal : m_red_goal); }
|
||||
{
|
||||
return (team == SOCCER_TEAM_BLUE ? m_blue_scorers.size() :
|
||||
m_red_scorers.size());
|
||||
}
|
||||
// ------------------------------------------------------------------------
|
||||
const std::vector<ScorerData>& getScorers(SoccerTeam team) const
|
||||
{ return (team == SOCCER_TEAM_BLUE ? m_blue_scorers : m_red_scorers); }
|
||||
|
Loading…
Reference in New Issue
Block a user