Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 28, 2009, 5:37:34 AM (15 years ago)
Author:
landauf
Message:

Added two new HUD-elements for TeamBaseMatch and UnderAttack

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/objects/gametypes/TeamBaseMatch.cc

    r3103 r3104  
    4646        this->pointsTeam1_ = 0;
    4747        this->pointsTeam2_ = 0;
     48
     49        this->setHUDTemplate("TeamBaseMatchHUD");
    4850    }
    4951
     
    5456        if (base)
    5557        {
    56             if ( !originator )
     58            if (!originator)
    5759                return false;
     60
    5861            std::set<TeamBaseMatchBase*>::const_iterator it = this->bases_.find(base);
    5962            if (it != this->bases_.end())
     
    217220    }
    218221
     222    int TeamBaseMatch::getTeamPoints(int team)
     223    {
     224        if(team == 0)
     225        {
     226            return this->pointsTeam1_;
     227        }
     228        if(team == 1)
     229        {
     230            return this->pointsTeam2_;
     231        }
     232
     233        return 0;
     234    }
     235
     236    int TeamBaseMatch::getTeamBases(int team)
     237    {
     238        int count = 0;
     239
     240        for (std::set<TeamBaseMatchBase*>::const_iterator it = this->bases_.begin(); it != this->bases_.end(); ++it)
     241        {
     242            if ((*it)->getState() == BaseState::controlTeam1 && team == 0)
     243                count++;
     244            if ((*it)->getState() == BaseState::controlTeam2 && team == 1)
     245                count++;
     246        }
     247
     248        return count;
     249    }
     250
    219251    void TeamBaseMatch::addBase(TeamBaseMatchBase* base)
    220252    {
Note: See TracChangeset for help on using the changeset viewer.