Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/modules/invader/InvaderShip.cc

    r10624 r11071  
    3737#include "core/XMLPort.h"
    3838#include "Invader.h"
     39#include "InvaderEnemy.h"
     40#include "graphics/Camera.h"
     41#include "weapons/projectiles/Projectile.h"
    3942
    4043namespace orxonox
     
    9295        // Camera
    9396        Camera* camera = this->getCamera();
    94         if (camera != NULL)
     97        if (camera != nullptr)
    9598        {
    9699            camera->setPosition(Vector3(-pos.z, -posforeward, 0));
     
    139142        isFireing = bBoost;
    140143    }
    141     inline bool InvaderShip::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
     144    void InvaderShip::rotateRoll(const Vector2& value)
     145    {
     146        if (getGame())
     147            if (getGame()->bEndGame)
     148                getGame()->end();
     149    }
     150    inline bool InvaderShip::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint)
    142151    {
    143152        // orxout() << "touch!!! " << endl; //<< otherObject << " at " << contactPoint;
     
    145154        Projectile* shot = orxonox_cast<Projectile*>(otherObject);
    146155        // ensure that this gets only called once per enemy.
    147         if (enemy != NULL && lastEnemy != enemy)
     156        if (enemy != nullptr && lastEnemy != enemy)
    148157        {
    149158            lastEnemy = enemy;
     
    156165        }
    157166        // was shot, decrease multiplier
    158         else if (shot != NULL  && lastShot != shot)
     167        else if (shot != nullptr  && lastShot != shot)
    159168        {
    160             if (getGame() && orxonox_cast<InvaderEnemy*>(shot->getShooter()) != NULL)
     169            if (getGame() && orxonox_cast<InvaderEnemy*>(shot->getShooter()) != nullptr)
    161170            {
    162171                if (getGame()->multiplier > 1)
     
    173182    Invader* InvaderShip::getGame()
    174183    {
    175         if (game == NULL)
     184        if (game == nullptr)
    176185        {
    177             for (ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it)
    178                 game = *it;
     186            for (Invader* invader : ObjectList<Invader>())
     187                game = invader;
    179188        }
    180189        return game;
Note: See TracChangeset for help on using the changeset viewer.