Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 20, 2011, 11:27:45 PM (13 years ago)
Author:
dafrick
Message:

Some cleanup…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/gametypes/SpaceRace.cc

    r8706 r8767  
    3131#include "core/CoreIncludes.h"
    3232#include "network/Host.h"
    33 #include <util/Clock.h>
    34 #include <util/Math.h>
    3533#include "util/Convert.h"
     34#include "util/Math.h"
    3635
    3736namespace orxonox
    3837{
    3938    CreateUnloadableFactory(SpaceRace);
    40    
     39
    4140    SpaceRace::SpaceRace(BaseObject* creator) : Gametype(creator)
    4241    {
    4342        RegisterObject(SpaceRace);
    44         this->bCheckpointsReached_ = 0;
     43        this->checkpointsReached_ = 0;
    4544        this->bTimeIsUp_ = false;
    4645        this->numberOfBots_ = 0;
    4746    }
    48    
     47
    4948    void SpaceRace::end()
    5049    {
    5150        this->Gametype::end();
    52          
     51
    5352        if (this->bTimeIsUp_)
    5453        {
     
    5756            int ms = this->clock_.getMilliseconds()-1000*s;
    5857            const std::string& message = multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds !!\n"
    59                         + "You didn't reach the check point " + multi_cast<std::string>(this->bCheckpointsReached_+1)
     58                        + "You didn't reach the check point " + multi_cast<std::string>(this->checkpointsReached_+1)
    6059                        + " before the time limit. You lose!";
    6160            COUT(3) << message;
    6261            const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
    63             Host::Broadcast(message);
    6462        }
    6563        else
     
    7270            COUT(3) << message << std::endl;
    7371            const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
    74             Host::Broadcast(message);
    7572            float time = this->clock_.getSecondsPrecise();
    7673            this->scores_.insert(time);
     
    8784        std::string message("The match has started! Reach the check points as quickly as possible!");
    8885        COUT(3) << message << std::endl;
    89         Host::Broadcast(message);
     86        const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
    9087    }
    91    
     88
    9289    void SpaceRace::newCheckpointReached()
    9390    {
    94         this->bCheckpointsReached_++;
     91        this->checkpointsReached_++;
    9592        this->clock_.capture();
    9693        int s = this->clock_.getSeconds();
     
    10198        COUT(3) << message;
    10299        const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
    103         Host::Broadcast(message);
    104100    }
    105101
Note: See TracChangeset for help on using the changeset viewer.