Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 10, 2016, 1:54:11 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v2 into cpp11_v3

Location:
code/branches/cpp11_v3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3

  • code/branches/cpp11_v3/src/modules/invader/Invader.cc

    r11052 r11054  
    6161        RegisterObject(Invader);
    6262        this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
    63         this->center_ = 0;
     63        this->center_ = nullptr;
    6464        bEndGame = false;
    6565        lives = 3;
     
    7878    {
    7979        level++;
    80         if (getPlayer() != NULL)
     80        if (getPlayer() != nullptr)
    8181        {
    8282            for (int i = 0; i < 7; i++)
     
    103103    InvaderShip* Invader::getPlayer()
    104104    {
    105         if (player == NULL)
     105        if (player == nullptr)
    106106        {
    107             for (ObjectList<InvaderShip>::iterator it = ObjectList<InvaderShip>::begin(); it != ObjectList<InvaderShip>::end(); ++it)
    108                 player = *it;
     107            for (InvaderShip* ship : ObjectList<InvaderShip>())
     108                player = ship;
    109109        }
    110110        return player;
     
    113113    void Invader::spawnEnemy()
    114114    {
    115         if (getPlayer() == NULL)
     115        if (getPlayer() == nullptr)
    116116            return;
    117117
     
    134134            newPawn->setPosition(player->getPosition() + Vector3(500.f + 100 * i, 0, float(rand())/RAND_MAX * 400 - 200));
    135135        }
     136    }
     137
     138    void Invader::setCenterpoint(InvaderCenterPoint* center)
     139    {
     140        this->center_ = center;
    136141    }
    137142
     
    160165        this->bForceSpawn_ = true;
    161166
    162         if (this->center_ == NULL)  // abandon mission!
     167        if (this->center_ == nullptr)  // abandon mission!
    163168        {
    164169            orxout(internal_error) << "Invader: No Centerpoint specified." << endl;
Note: See TracChangeset for help on using the changeset viewer.