Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 23, 2009, 7:04:10 PM (15 years ago)
Author:
landauf
Message:

some small adjustments in all the new gametype classes

File:
1 edited

Legend:

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

    r3019 r3020  
    2020 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    2121 *
    22  *   Author: Val Mikos
     22 *   Author:
     23 *      Val Mikos
     24 *   Co-authors:
     25 *      ...
     26 *
    2327 */
    24  
    25  
    2628
    2729#include "TeamBaseMatch.h"
    2830
    29 
    30 #include "objects/worldentities/pawns/TeamBaseMatchBase.h"
     31#include "objects/worldentities/pawns/TeamBaseMatchBase.h"
    3132#include "core/CoreIncludes.h"
    32 #include "core/XMLPort.h"
    33 
    34  
     33
    3534namespace orxonox
    3635{
    3736    CreateUnloadableFactory(TeamBaseMatch);
    3837
    39 
    40     // Timer and Creator
    4138    TeamBaseMatch::TeamBaseMatch(BaseObject* creator) : TeamDeathmatch(creator)
    4239    {
     
    4946        this->pointsTeam2_ = 0;
    5047    }
    51      
    52    
    53     // set the Bases positions using XML
    54     void TeamBaseMatch::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    55     {
    56         SUPER(TeamBaseMatch, XMLPort, xmlelement, mode);
    57 
    58 //        XMLPortObject(TeamBaseMatch, WorldEntity, setNeutralshape, getNeturalshape, xmlelement, mode);
    59 //        XMLPortObject(TeamBaseMatch, WorldEntity, setTeam1shape, getTeam1shape, xmlelement, mode);
    60 //        XMLPortObject(TeamBaseMatch, WorldEntity, setTeam2shape, getTeam2shape, xmlelement, mode);
    61 
    62 //        XMLPortObject(TeamBaseMatch, TeamBaseMatchBase,  addBase, getBase, xmlelement, mode);
    63     }
    64    
    65 /*
    66     // pretty useless at the moment...should be implemented in the TeamBaseMatchBase class headerfile
    67     // State of the Base (controlled, uncontrolled)
    68     int TeamBaseMatch::baseState(Base)
    69     {
    70         if(Enum state_==uncontrolled) return 0;
    71         if(Enum state_==controlTeam1) return 1;
    72         if(Enum state_==controlTeam2) return 2;
    73     }
    74 */ 
    75 
    7648
    7749    // Change the control of the defeated base and respawn it with its initial health
     
    11789        {
    11890            std::map<PlayerInfo*, int>::const_iterator it1 = this->teamnumbers_.find(pawn1->getPlayer());
    119             int teamnrbase = -1;
    120             int teamnrplayer = getTeam(pawn1->getPlayer());
    121 
    122             switch(base->getState())
     91            int teamnrbase = -1;
     92            int teamnrplayer = getTeam(pawn1->getPlayer());
     93
     94            switch (base->getState())
    12395            {
    12496                case BaseState::controlTeam1:
     
    130102                case BaseState::uncontrolled:
    131103                default:
    132                     teamnrbase = -1;
    133             }
    134 
    135 
    136             if(teamnrbase == teamnrplayer){
    137                 return false;
    138             }
     104                    teamnrbase = -1;
     105            }
     106
     107            if (teamnrbase == teamnrplayer)
     108                return false;
    139109        }
    140110        return true;
     
    155125    void TeamBaseMatch::showPoints()
    156126    {
    157        
     127
    158128        COUT(0) << "Points standing:" << std::endl << "Team 1: "<< pointsTeam1_ << std::endl << "Team 2: " << pointsTeam2_ << std::endl;
    159129        if(pointsTeam1_ >=1700) COUT(0) << "Team 1 is near victory!" << std::endl;
     
    205175        {
    206176            this->pointsTeam2_ += points;
    207         }     
     177        }
    208178
    209179        this->endGame();
     
    227197        return 0;
    228198    }
    229    
     199
    230200}
    231201
    232  
     202
Note: See TracChangeset for help on using the changeset viewer.