Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Added two new HUD-elements for TeamBaseMatch and UnderAttack

Location:
code/trunk/src/orxonox/objects/gametypes
Files:
3 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    {
  • code/trunk/src/orxonox/objects/gametypes/TeamBaseMatch.h

    r3033 r3104  
    5555
    5656            void addTeamPoints(int team, int points);
     57            int getTeamPoints(int team);
     58            int getTeamBases(int team);
    5759
    5860        protected:
  • code/trunk/src/orxonox/objects/gametypes/UnderAttack.cc

    r3099 r3104  
    4949        this->destroyer_ = 0;
    5050        this->gameEnded_ = false;
     51
     52        this->setHUDTemplate("UnderAttackHUD");
    5153
    5254        this->setConfigValues();
Note: See TracChangeset for help on using the changeset viewer.