Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 14, 2011, 2:38:37 PM (13 years ago)
Author:
jo
Message:

teamgametype merged into trunk

Location:
code/branches/presentation2011
Files:
25 edited
4 copied

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2011

  • TabularUnified code/branches/presentation2011/src/libraries/core/GUIManager.cc

    r8862 r8980  
    223223
    224224    GUIManager* GUIManager::singletonPtr_s = 0;
    225     /*static*/ const std::string GUIManager::defaultScheme_ = "TaharezGreen";
     225    /*static*/ const std::string GUIManager::defaultScheme_ = "Orxonox"; //TaharezGreen
    226226
    227227    SetConsoleCommand("showGUI", &GUIManager::showGUI).defaultValue(1, false).defaultValue(2, false);
  • TabularUnified code/branches/presentation2011/src/modules/pong/Pong.cc

    r8858 r8980  
    3737#include "core/EventIncludes.h"
    3838#include "core/command/Executor.h"
     39#include "core/ConfigValueIncludes.h"
    3940
    4041#include "gamestates/GSLevel.h"
     42#include "chat/ChatManager.h"
    4143
    4244#include "PongCenterpoint.h"
     
    4547#include "PongBot.h"
    4648#include "PongAI.h"
    47 
    4849namespace orxonox
    4950{
     
    7576        // Set the type of Bots for this particular Gametype.
    7677        this->botclass_ = Class(PongBot);
     78        this->scoreLimit_ = 10;
     79        this->setConfigValues();
    7780    }
    7881
     
    280283        }
    281284
     285        // If a palyer gets 21 points, he won the game -> end of game
     286       
     287        PlayerInfo* player1 = this->getLeftPlayer();
     288        PlayerInfo* player2 = this->getRightPlayer();
     289        if(player1==NULL||player2==NULL) return; //safety
     290        if(this->getScore(player1) >= scoreLimit_)
     291        {
     292            std::string name1=player1->getName();
     293            std::string message(name1 + " has won!");
     294            ChatManager::message(message);
     295            this->end();
     296        }
     297        else if(this->getScore(player2) >= scoreLimit_)
     298        {
     299             std::string name2=player2->getName();
     300             std::string message2(name2 + " has won!");
     301             ChatManager::message(message2);
     302             this->end();
     303        }
    282304        // Restart the timer to start the ball.
    283305        this->starttimer_.startTimer();
     306
    284307    }
    285308
     
    321344            return 0;
    322345    }
     346
     347    /**
     348     @brief
     349         Make scoreLimit_ configurable e.g. in the menu.
     350     */
     351    void Pong::setConfigValues()
     352    {
     353        SetConfigValue(scoreLimit_, 10).description("The player first reaching those points wins.");
     354    }
    323355}
  • TabularUnified code/branches/presentation2011/src/modules/pong/Pong.h

    r8351 r8980  
    8181            void setCenterpoint(PongCenterpoint* center)
    8282                { this->center_ = center; }
    83 
    84             PlayerInfo* getLeftPlayer() const; //!< Get the left player.
     83            void setConfigValues(); //!< Makes scoreLimit configurable.
     84           
     85            PlayerInfo* getLeftPlayer() const; //!< Get the left player.
    8586            PlayerInfo* getRightPlayer() const; //!< Get the right player.
    8687
     
    9495            WeakPtr<PongBall> ball_; //!< The Pong ball.
    9596            WeakPtr<PongBat> bat_[2]; //!< The two bats.
    96             Timer starttimer_; //!< A timer to delay the start of the game.
     97            Timer starttimer_; //!< A timer to delay the start of the game.
     98            int scoreLimit_; //!< If a player scored that much points, the game is ended.
    9799    };
    98100}
  • TabularUnified code/branches/presentation2011/src/modules/pong/PongAI.h

    r8108 r8980  
    8080            void delayedMove(); //!< Is called, when a delayed move takes effect.
    8181
    82             PongBall* ball_; //!< A pointer to the ball.
     82            WeakPtr<PongBall> ball_; //!< A weak pointer to the ball.
    8383            Vector2 ballDirection_; //!< Vector to store the (x,z) direction in which the ball is flying.
    8484            float ballEndPosition_; //!< The calculated end position of the ball.
  • TabularUnified code/branches/presentation2011/src/modules/pong/PongScore.cc

    r8108 r8980  
    6060        this->bShowLeftPlayer_ = false;
    6161        this->bShowRightPlayer_ = false;
     62        this->player1_ = NULL;
     63        this->player2_ = NULL;
    6264    }
    6365
     
    98100        if (this->owner_ != NULL)
    99101        {
    100             // Get the two players.
    101             PlayerInfo* player1 = this->owner_->getLeftPlayer();
    102             PlayerInfo* player2 = this->owner_->getRightPlayer();
    103 
    104             std::string name1;
    105             std::string name2;
    106 
    107             std::string score1("0");
    108             std::string score2("0");
    109 
    110             // Save the name and score of each player as a string.
    111             if (player1 != NULL)
     102            if(!this->owner_->hasEnded())
    112103            {
    113                 name1 = player1->getName();
    114                 score1 = multi_cast<std::string>(this->owner_->getScore(player1));
    115             }
    116             if (player2 != NULL)
    117             {
    118                 name2 = player2->getName();
    119                 score2 = multi_cast<std::string>(this->owner_->getScore(player2));
     104                //get the two players
     105                player1_ = this->owner_->getLeftPlayer();
     106                player2_ = this->owner_->getRightPlayer();
    120107            }
    121108
    122             // Assemble the strings, depending on what should all be displayed.
    123             std::string output1;
    124             if (this->bShowLeftPlayer_)
     109            if(this->owner_->hasStarted())
    125110            {
    126                 if (this->bShowName_ && this->bShowScore_ && player1 != NULL)
    127                     output1 = name1 + " - " + score1;
    128                 else if (this->bShowScore_)
    129                     output1 = score1;
    130                 else if (this->bShowName_)
    131                     output1 = name1;
    132             }
     111                // Get the two players.
    133112
    134             std::string output2;
    135             if (this->bShowRightPlayer_)
    136             {
    137                 if (this->bShowName_ && this->bShowScore_ && player2 != NULL)
     113                std::string name1;
     114                std::string name2;
     115
     116                std::string score1("0");
     117                std::string score2("0");
     118
     119                // Save the name and score of each player as a string.
     120                if (player1_ != NULL)
     121                {
     122                    name1 = player1_->getName();
     123                    score1 = multi_cast<std::string>(this->owner_->getScore(player1_));
     124                }
     125                if (player2_ != NULL)
     126                {
     127                    name2 = player2_->getName();
     128                    score2 = multi_cast<std::string>(this->owner_->getScore(player2_));
     129                }
     130
     131                // Assemble the strings, depending on what should all be displayed.
     132                std::string output1;
     133                if (this->bShowLeftPlayer_)
     134                {
     135                    if (this->bShowName_ && this->bShowScore_ && player1_ != NULL)
     136                         output1 = name1 + " - " + score1;
     137                    else if (this->bShowScore_)
     138                         output1 = score1;
     139                    else if (this->bShowName_)
     140                         output1 = name1;
     141                }
     142
     143                std::string output2;
     144                if (this->bShowRightPlayer_)
     145                {
     146                if (this->bShowName_ && this->bShowScore_ && player2_ != NULL)
    138147                    output2 = score2 + " - " + name2;
    139148                else if (this->bShowScore_)
     
    143152            }
    144153
    145             std::string output("PONG");
    146             if (this->bShowName_ || this->bShowScore_)
    147             {
    148                 if (this->bShowLeftPlayer_ && this->bShowRightPlayer_)
    149                     output = output1 + ':' + output2;
    150                 else if (this->bShowLeftPlayer_ || this->bShowRightPlayer_)
    151                     output = output1 + output2;
     154                std::string output("PONG");
     155                if (this->bShowName_ || this->bShowScore_)
     156                {
     157                    if (this->bShowLeftPlayer_ && this->bShowRightPlayer_)
     158                        output = output1 + ':' + output2;
     159                    else if (this->bShowLeftPlayer_ || this->bShowRightPlayer_)
     160                        output = output1 + output2;
     161                }
     162                this->setCaption(output);
    152163            }
    153 
    154             this->setCaption(output);
    155164        }
    156165    }
  • TabularUnified code/branches/presentation2011/src/modules/pong/PongScore.h

    r8108 r8980  
    122122            bool bShowLeftPlayer_; //!< Whether the left player is shown.
    123123            bool bShowRightPlayer_; //!< Whether the right player is shown.
     124            PlayerInfo* player1_; //!< Store information about left player permanently.
     125            PlayerInfo* player2_; //!< Same for the right player. To end the game properly.
    124126    };
    125127}
  • TabularUnified code/branches/presentation2011/src/modules/weapons/projectiles/Rocket.cc

    r8891 r8980  
    6666        this->localAngularVelocity_ = 0;
    6767        this->lifetime_ = 100.0f;
    68         this->bIsRocket_= true;
    6968
    7069        if (GameMode::isMaster())
     
    135134        if(this->isInitialized())
    136135        {
    137             this->bIsRocket_= false;
    138136            if (GameMode::isMaster())
    139137            {
  • TabularUnified code/branches/presentation2011/src/modules/weapons/weaponmodes/LightningGun.cc

    r8855 r8980  
    5252        this->reloadTime_ = 1.0f;
    5353        this->damage_ = 0.0f;
    54         this->speed_ = 250.0f;
     54        this->speed_ = 700.0f;
    5555
    5656        this->setMunitionName("LaserMunition");
  • TabularUnified code/branches/presentation2011/src/orxonox/controllers/AIController.cc

    r8891 r8980  
    7474            }
    7575
    76             // search enemy
    77             random = rnd(maxrand);
    78             if (random < (15 + botlevel_* 20) && (!this->target_))
    79                 this->searchNewTarget();
    80 
    81             // forget enemy
    82             random = rnd(maxrand);
    83             if (random < ((1-botlevel_)*6) && (this->target_))
    84                 this->forgetTarget();
    85 
    86             // next enemy
    87             random = rnd(maxrand);
    88             if (random < (botlevel_*20) && (this->target_))
    89                 this->searchNewTarget();
    90 
    91             // fly somewhere
    92             random = rnd(maxrand);
    93             if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
    94                 this->searchRandomTargetPosition();
    95 
    96             // stop flying
    97             random = rnd(maxrand);
    98             if (random < 10 && (this->bHasTargetPosition_ && !this->target_))
    99                 this->bHasTargetPosition_ = false;
    100 
    101             // fly somewhere else
    102             random = rnd(maxrand);
    103             if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
    104                 this->searchRandomTargetPosition();
    105 
    106             // shoot
    107             random = rnd(maxrand);
    108             if (!(this->passive_) && random < (75 + botlevel_*25) && (this->target_ && !this->bShooting_))
    109                 this->bShooting_ = true;
    110 
    111             // stop shooting
    112             random = rnd(maxrand);
    113             if (random < ((1 - botlevel_)*25) && (this->bShooting_))
    114                 this->bShooting_ = false;
    115 
    116             // boost
    117             random = rnd(maxrand);
    118             if (random < botlevel_*100 )
    119                 this->boostControl();
    120 
    121             // update Checkpoints
    122             /*random = rnd(maxrand);
    123             if (this->defaultWaypoint_ && random > (maxrand-10))
    124                 this->manageWaypoints();
    125             else //if(random > maxrand-10) //CHECK USABILITY!!*/
    126             if (this->waypoints_.size() == 0 )
    127                 this->manageWaypoints();
    128 
     76            this->defaultBehaviour(maxrand);
    12977        }
    13078
     
    13684        if (this->state_ == MASTER)
    13785        {
    138 
    139 
    14086            this->commandSlaves();
    14187
     
    170116                    this->searchNewMaster();
    171117
    172                 // search enemy
    173                 random = rnd(maxrand);
    174                 if (random < (botlevel_)*25 && (!this->target_))
    175                     this->searchNewTarget();
    176 
    177                 // forget enemy
    178                 random = rnd(maxrand);
    179                 if (random < (1-botlevel_)*6 && (this->target_))
    180                     this->forgetTarget();
    181 
    182                 // next enemy
    183                 random = rnd(maxrand);
    184                 if (random < 10 && (this->target_))
    185                     this->searchNewTarget();
    186 
    187                 // fly somewhere
    188                 random = rnd(maxrand);
    189                 if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
    190                     this->searchRandomTargetPosition();
    191 
    192 
    193                 // fly somewhere else
    194                 random = rnd(maxrand);
    195                 if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
    196                     this->searchRandomTargetPosition();
    197 
    198                 // shoot
    199                 random = rnd(maxrand);
    200                 if (!(this->passive_) && random < 25*(botlevel_)+1 && (this->target_ && !this->bShooting_))
    201                 {
    202                     this->bShooting_ = true;
    203                     this->forceFreeSlaves();
    204                 }
    205 
    206                 // stop shooting
    207                 random = rnd(maxrand);
    208                 if (random < ( (1- botlevel_)*25 ) && (this->bShooting_))
    209                     this->bShooting_ = false;
    210 
    211                 // boost
    212                 random = rnd(maxrand);
    213                 if (random < botlevel_*100 )
    214                     this->boostControl();
    215 
    216                 // update Checkpoints
    217                 /*random = rnd(maxrand);
    218                 if (this->defaultWaypoint_ && random > (maxrand-10))
    219                     this->manageWaypoints();
    220                 else //if(random > maxrand-10) //CHECK USABILITY!!*/
    221                 if (this->waypoints_.size() == 0 )
    222                     this->manageWaypoints();
     118                this->defaultBehaviour(maxrand);
    223119            }
    224120        }
    225 
    226121    }
    227122
     
    321216        {   //Vector-implementation: mode_.back() == ROCKET;
    322217            if(controllable)
    323             {
    324                 if(controllable->getRocket())//Check wether the bot is controlling the rocket and if the timeout is over.
     218            {//Check wether the bot is controlling the rocket and if the timeout is over.
     219                if(controllable->getIdentifier() == ClassByString("Rocket"))
     220
    325221                {
    326222                    this->follow();
     
    342238    }
    343239
     240    void AIController::defaultBehaviour(float maxrand)
     241    {       float random;
     242            // search enemy
     243            random = rnd(maxrand);
     244            if (random < (botlevel_* 100) && (!this->target_))
     245                this->searchNewTarget();
     246
     247            // forget enemy
     248            random = rnd(maxrand);
     249            if (random < ((1-botlevel_)*20) && (this->target_))
     250                this->forgetTarget();
     251
     252            // next enemy
     253            random = rnd(maxrand);
     254            if (random < (botlevel_*30) && (this->target_))
     255                this->searchNewTarget();
     256
     257            // fly somewhere
     258            random = rnd(maxrand);
     259            if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
     260                this->searchRandomTargetPosition();
     261
     262            // stop flying
     263            random = rnd(maxrand);
     264            if (random < 10 && (this->bHasTargetPosition_ && !this->target_))
     265                this->bHasTargetPosition_ = false;
     266
     267            // fly somewhere else
     268            random = rnd(maxrand);
     269            if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
     270                this->searchRandomTargetPosition();
     271
     272            if (this->state_ == MASTER) // master: shoot
     273            {
     274                random = rnd(maxrand);
     275                if (!(this->passive_) && random < (100*botlevel_) && (this->target_ && !this->bShooting_))
     276                {
     277                    this->bShooting_ = true;
     278                    this->forceFreeSlaves();
     279                }
     280            }
     281            else
     282            {
     283                // shoot
     284                random = rnd(maxrand);
     285                if (!(this->passive_) && random < (botlevel_*100) && (this->target_ && !this->bShooting_))
     286                    this->bShooting_ = true;
     287            }
     288
     289            // stop shooting
     290            random = rnd(maxrand);
     291            if (random < ((1 - botlevel_)*50) && (this->bShooting_))
     292                this->bShooting_ = false;
     293
     294            // boost
     295            random = rnd(maxrand);
     296            if (random < botlevel_*50 )
     297                this->boostControl();
     298
     299            // update Checkpoints
     300            /*random = rnd(maxrand);
     301            if (this->defaultWaypoint_ && random > (maxrand-10))
     302                this->manageWaypoints();
     303            else //if(random > maxrand-10) //CHECK USABILITY!!*/
     304            if (this->waypoints_.size() == 0 )
     305                this->manageWaypoints();
     306    }
     307
    344308}
  • TabularUnified code/branches/presentation2011/src/orxonox/controllers/AIController.h

    r8729 r8980  
    4444            virtual ~AIController();
    4545
    46             virtual void tick(float dt);
     46            virtual void tick(float dt); //<! Carrying out the targets set in action().
    4747
    4848        protected:
    49             virtual void action();
     49            virtual void action(); //<! action() is called in regular intervals managing the bot's behaviour ~ setting targets.
     50            void defaultBehaviour(float maxrand); //<! Helper function for code reusage. Some concrete commands for a bot.
    5051
    5152        private:
    5253            static const float ACTION_INTERVAL;
    5354
    54             Timer actionTimer_;
     55            Timer actionTimer_; //<! Regularly calls action().
    5556    };
    5657}
  • TabularUnified code/branches/presentation2011/src/orxonox/controllers/ArtificialController.cc

    r8892 r8980  
    4242#include "gametypes/TeamDeathmatch.h"
    4343#include "gametypes/Dynamicmatch.h"
     44#include "gametypes/Mission.h"
    4445#include "controllers/WaypointPatrolController.h"
    4546#include "controllers/NewHumanController.h"
     
    9293        this->target_.setCallback(createFunctor(&ArtificialController::targetDied, this));
    9394        this->bSetupWorked = false;
    94         this->botlevel_ = 0.2f;
     95        this->botlevel_ = 0.5f;
    9596        this->mode_ = DEFAULT;////Vector-implementation: mode_.push_back(DEFAULT);
    9697        this->timeout_ = 0;
     
    998999        }
    9991000
     1001        Mission* miss = orxonox_cast<Mission*>(gametype);
     1002        if (miss)
     1003        {
     1004            if (entity1->getPlayer())
     1005                team1 = miss->getTeam(entity1->getPlayer());
     1006
     1007            if (entity2->getPlayer())
     1008                team2 = miss->getTeam(entity2->getPlayer());
     1009        }
     1010
    10001011        TeamBaseMatchBase* base = 0;
    10011012        base = orxonox_cast<TeamBaseMatchBase*>(entity1);
     
    11101121        {
    11111122            Pawn* pawn = orxonox_cast<Pawn*>(this->getControllableEntity());
    1112             if(pawn)
     1123            if(pawn && pawn->isA(Class(SpaceShip))) //fix for First Person Mode: check for SpaceShip
    11131124            {
    11141125                this->weaponModes_.clear(); // reset previous weapon information
  • TabularUnified code/branches/presentation2011/src/orxonox/controllers/ArtificialController.h

    r8891 r8980  
    5151            void abandonTarget(Pawn* target);
    5252
    53             inline void setTeam(int team)
     53            inline void setTeam(int team) //TODO: write through to controllable entity.
    5454                { this->team_ = team; }
    5555            inline int getTeam() const
  • TabularUnified code/branches/presentation2011/src/orxonox/controllers/HumanController.cc

    r8858 r8980  
    195195            this->boosting_ = true;
    196196            this->boostingTimeout_.startTimer();
    197            
    198             this->controllableEntity_->boost(this->boosting_);
     197            if(this->controllableEntity_)
     198                this->controllableEntity_->boost(this->boosting_);
    199199//            orxout() << "Start boosting" << endl;
    200200        }
     
    209209        this->boosting_ = false;
    210210        this->boostingTimeout_.stopTimer();
    211 
    212         this->controllableEntity_->boost(this->boosting_);
     211        if(this->controllableEntity_)
     212            this->controllableEntity_->boost(this->boosting_);
    213213//        orxout() << "Stop boosting" << endl;
    214214    }
  • TabularUnified code/branches/presentation2011/src/orxonox/controllers/WaypointPatrolController.cc

    r7184 r8980  
    4242        RegisterObject(WaypointPatrolController);
    4343
    44         //this->team_ = 0;
    4544        this->alertnessradius_ = 500;
    4645
     
    5352
    5453        XMLPortParam(WaypointPatrolController, "alertnessradius", setAlertnessRadius, getAlertnessRadius, xmlelement, mode).defaultValues(500.0f);
    55 //        XMLPortParam(WaypointPatrolController, "team", setTeam, getTeam, xmlelement, mode).defaultValues(0);
    5654    }
    5755
  • TabularUnified code/branches/presentation2011/src/orxonox/controllers/WaypointPatrolController.h

    r7163 r8980  
    4646            virtual void tick(float dt);
    4747
    48            /* inline void setTeam(int team)
    49                 { this->team_ = team; }
    50             inline int getTeam() const
    51                 { return this->team_; } */
    52 
    5348            inline void setAlertnessRadius(float radius)
    5449                { this->alertnessradius_ = radius; }
     
    5954            void searchEnemy();
    6055
    61             //int team_;
    6256            float alertnessradius_;
    6357            Timer patrolTimer_;
  • TabularUnified code/branches/presentation2011/src/orxonox/gametypes/CMakeLists.txt

    r8178 r8980  
    99  LastManStanding.cc
    1010  LastTeamStanding.cc
     11  TeamGametype.cc
     12  Mission.cc
    1113)
  • TabularUnified code/branches/presentation2011/src/orxonox/gametypes/Gametype.cc

    r8858 r8980  
    8585        this->dedicatedKillBots_ = createConsoleCommand( "dedicatedKillBots", createExecutor( createFunctor(&Gametype::killBots, this) ) );
    8686        /* HACK HACK HACK */
     87        //this->numberOfPlayers_ = 0;
    8788    }
    8889
     
    132133                    this->gtinfo_->playerReadyToSpawn(it->first);
    133134            }
    134                    
     135
    135136            this->checkStart();
    136137        }
     
    439440            if(player->isHumanPlayer())
    440441                this->gtinfo_->playerSpawned(player);
    441            
     442
    442443            this->playerPostSpawn(player);
    443444        }
  • TabularUnified code/branches/presentation2011/src/orxonox/gametypes/Gametype.h

    r8706 r8980  
    123123                { return this->gtinfo_->getHUDTemplate(); }
    124124
    125             void addBots(unsigned int amount);
     125            virtual void addBots(unsigned int amount);
    126126            void killBots(unsigned int amount = 0);
    127 
    128             inline unsigned int getNumberOfPlayers() const
    129                 { return this->players_.size(); }
    130127
    131128            virtual void addTime(float t);
     
    151148
    152149            //inline bool getForceSpawn()
    153             //  { return this->bForceSpawn_; }       
     150            //  { return this->bForceSpawn_; }
    154151
    155152            virtual void resetTimer();
    156153            virtual void resetTimer(float t);
     154            inline unsigned int getNumberOfPlayers()
     155              { return this->gtinfo_->getNumberOfPlayers(); }
    157156
    158157        protected:
     
    192191            ConsoleCommand* dedicatedKillBots_;
    193192            /* HACK HACK HACK */
     193
    194194    };
    195195}
  • TabularUnified code/branches/presentation2011/src/orxonox/gametypes/TeamDeathmatch.h

    r5781 r8980  
    5656
    5757            int getTeam(PlayerInfo* player);
    58 
    5958            inline const ColourValue& getTeamColour(int teamnr) const
    6059                { return this->teamcolours_[teamnr]; }
  • TabularUnified code/branches/presentation2011/src/orxonox/infos/GametypeInfo.h

    r8706 r8980  
    119119            inline const std::string& getHUDTemplate() const
    120120                { return this->hudtemplate_; }
     121           
     122            inline unsigned int getNumberOfPlayers() const
     123                {  return this->spawnedPlayers_.size(); }
    121124
    122125            void sendAnnounceMessage(const std::string& message);
  • TabularUnified code/branches/presentation2011/src/orxonox/worldentities/ControllableEntity.cc

    r8891 r8980  
    7474        this->bMouseLook_ = false;
    7575        this->mouseLookSpeed_ = 200;
    76         this->bIsRocket_ = false;
    7776
    7877        this->server_position_         = Vector3::ZERO;
     
    8887        this->setPriority( Priority::VeryHigh );
    8988        this->registerVariables();
     89        this->team_ = -1;
    9090    }
    9191
     
    120120        SUPER(ControllableEntity, XMLPort, xmlelement, mode);
    121121
     122        XMLPortParam(ControllableEntity, "team", setTeam, getTeam, xmlelement, mode).defaultValues(-1);
    122123        XMLPortParam(ControllableEntity, "hudtemplate", setHudTemplate, getHudTemplate, xmlelement, mode);
    123124        XMLPortParam(ControllableEntity, "camerapositiontemplate", setCameraPositionTemplate, getCameraPositionTemplate, xmlelement, mode);
  • TabularUnified code/branches/presentation2011/src/orxonox/worldentities/ControllableEntity.h

    r8891 r8980  
    163163                { return this->target_.get(); }
    164164            void setTargetInternal( uint32_t targetID );
    165             inline bool getRocket() const
    166                 { return this-> bIsRocket_; }
     165
     166            inline void setTeam(int team)
     167                { this->team_ = team; }
     168            inline float getTeam() const
     169                { return this->team_; }
    167170
    168171        protected:
     
    183186
    184187            Ogre::SceneNode* cameraPositionRootNode_;
    185             bool bIsRocket_; //Workaround to see, if the controllable entity is a Rocket.
    186188
    187189        private:
     
    240242            CameraPosition* reverseCamera_;
    241243            WeakPtr<WorldEntity> target_;
     244
     245            int team_ ; //<! teamnumber
    242246    };
    243247}
  • TabularUnified code/branches/presentation2011/src/orxonox/worldentities/pawns/Pawn.cc

    r8891 r8980  
    129129        XMLPortParam(Pawn, "reloadrate", setReloadRate, getReloadRate, xmlelement, mode).defaultValues(0);
    130130        XMLPortParam(Pawn, "reloadwaittime", setReloadWaitTime, getReloadWaitTime, xmlelement, mode).defaultValues(1.0f);
     131
     132
    131133    }
    132134
     
    455457        SUPER(Pawn, changedActivity);
    456458
    457         this->setRadarVisibility(this->isActive());
     459        this->setRadarVisibility(this->isVisible());
    458460    }
    459461
  • TabularUnified code/branches/presentation2011/src/orxonox/worldentities/pawns/Pawn.h

    r8891 r8980  
    5353            inline bool isAlive() const
    5454                { return this->bAlive_; }
     55
    5556
    5657            virtual void setHealth(float health);
     
    194195                { return NULL; }
    195196
     197
    196198            float health_;
    197199            float maxHealth_;
Note: See TracChangeset for help on using the changeset viewer.