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:
9 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3

  • code/branches/cpp11_v3/src/modules/pickup/items/DamageBoostPickup.cc

    r9667 r11054  
    106106
    107107        SpaceShip* ship = this->carrierToSpaceShipHelper();
    108         if(ship == NULL) // If the PickupCarrier is no SpaceShip, then this pickup is useless and therefore is destroyed.
     108        if(ship == nullptr) // If the PickupCarrier is no SpaceShip, then this pickup is useless and therefore is destroyed.
    109109            this->Pickupable::destroy();
    110110
     
    152152        Helper to transform the PickupCarrier to a SpaceShip, and throw an error message if the conversion fails.
    153153    @return
    154         A pointer to the SpaceShip, or NULL if the conversion failed.
     154        A pointer to the SpaceShip, or nullptr if the conversion failed.
    155155    */
    156156    SpaceShip* DamageBoostPickup::carrierToSpaceShipHelper(void)
     
    159159        SpaceShip* ship = orxonox_cast<SpaceShip*>(carrier);
    160160
    161         if(ship == NULL)
     161        if(ship == nullptr)
    162162        {
    163163            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in DamageBoostPickup." << endl;
  • code/branches/cpp11_v3/src/modules/pickup/items/DronePickup.cc

    r9667 r11054  
    122122
    123123                Pawn* pawn = this->carrierToPawnHelper();
    124                 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     124                if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    125125                    this->Pickupable::destroy();
    126126
     
    131131                Controller* controller = drone->getController();
    132132                DroneController* droneController = orxonox_cast<DroneController*>(controller);
    133                 if(droneController != NULL)
     133                if(droneController != nullptr)
    134134                {
    135135                    droneController->setOwner(pawn);
     
    156156        Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
    157157    @return
    158         A pointer to the Pawn, or NULL if the conversion failed.
     158        A pointer to the Pawn, or nullptr if the conversion failed.
    159159    */
    160160    Pawn* DronePickup::carrierToPawnHelper(void)
     
    163163        Pawn* pawn = orxonox_cast<Pawn*>(carrier);
    164164
    165         if(pawn == NULL)
     165        if(pawn == nullptr)
    166166        {
    167167            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in DronePickup." << endl;
  • code/branches/cpp11_v3/src/modules/pickup/items/HealthPickup.cc

    r9667 r11054  
    114114        {
    115115            Pawn* pawn = this->carrierToPawnHelper();
    116             if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     116            if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    117117                this->Pickupable::destroy();
    118118
     
    168168            {
    169169                Pawn* pawn = this->carrierToPawnHelper();
    170                 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     170                if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    171171                    this->Pickupable::destroy();
    172172
     
    206206                Pawn* pawn = orxonox_cast<Pawn*>(carrier);
    207207
    208                 if(pawn == NULL)
     208                if(pawn == nullptr)
    209209                {
    210210                    orxout(internal_error, context::pickups) << "Something went horribly wrong in Health Pickup. PickupCarrier is '" << carrier->getIdentifier()->getName() << "' instead of Pawn." << endl;
     
    233233        Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
    234234    @return
    235         A pointer to the Pawn, or NULL if the conversion failed.
     235        A pointer to the Pawn, or nullptr if the conversion failed.
    236236    */
    237237    Pawn* HealthPickup::carrierToPawnHelper(void)
     
    240240        Pawn* pawn = orxonox_cast<Pawn*>(carrier);
    241241
    242         if(pawn == NULL)
     242        if(pawn == nullptr)
    243243            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in HealthPickup." << endl;
    244244
  • code/branches/cpp11_v3/src/modules/pickup/items/InvisiblePickup.cc

    r9667 r11054  
    139139    {
    140140        Pawn* pawn = this->carrierToPawnHelper();
    141         if(pawn == NULL)
     141        if(pawn == nullptr)
    142142            return false;
    143143
     
    163163        Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
    164164    @return
    165         A pointer to the Pawn, or NULL if the conversion failed.
     165        A pointer to the Pawn, or nullptr if the conversion failed.
    166166    */
    167167    Pawn* InvisiblePickup::carrierToPawnHelper(void)
     
    170170        Pawn* pawn = orxonox_cast<Pawn*>(carrier);
    171171
    172         if(pawn == NULL)
     172        if(pawn == nullptr)
    173173        {
    174174            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in InvisiblePickup." << endl;
  • code/branches/cpp11_v3/src/modules/pickup/items/MetaPickup.cc

    r9667 r11054  
    107107        {
    108108            PickupCarrier* carrier = this->getCarrier();
    109             if(this->getMetaType() != pickupMetaType::none && carrier != NULL)
     109            if(this->getMetaType() != pickupMetaType::none && carrier != nullptr)
    110110            {
    111111                // If the metaType is destroyCarrier, then the PickupCarrier is destroyed.
     
    118118                std::set<Pickupable*> pickups = carrier->getPickups();
    119119                // Iterate over all Pickupables of the PickupCarrier.
    120                 for(std::set<Pickupable*>::iterator it = pickups.begin(); it != pickups.end(); it++)
     120                for(Pickupable* pickup : pickups)
    121121                {
    122                     Pickupable* pickup = (*it);
    123                     if(pickup == NULL || pickup == this)
     122                    if(pickup == nullptr || pickup == this)
    124123                        continue;
    125124
  • code/branches/cpp11_v3/src/modules/pickup/items/ShieldPickup.cc

    r9667 r11054  
    9999
    100100        Pawn* pawn = this->carrierToPawnHelper();
    101         if(pawn == NULL)
     101        if(pawn == nullptr)
    102102            this->Pickupable::destroy();
    103103
     
    143143    Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
    144144    @return
    145     A pointer to the Pawn, or NULL if the conversion failed.
     145    A pointer to the Pawn, or nullptr if the conversion failed.
    146146    */
    147147    Pawn* ShieldPickup::carrierToPawnHelper(void)
     
    150150        Pawn* pawn = orxonox_cast<Pawn*>(carrier);
    151151
    152         if(pawn == NULL)
     152        if(pawn == nullptr)
    153153        {
    154154            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in ShieldPickup." << endl;
  • code/branches/cpp11_v3/src/modules/pickup/items/ShrinkPickup.cc

    r10624 r11054  
    146146        {
    147147            Pawn* pawn = this->carrierToPawnHelper();
    148             if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     148            if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    149149            {
    150150                this->Pickupable::destroy();
     
    173173                //TODO: Deploy particle effect.
    174174                Pawn* pawn = this->carrierToPawnHelper();
    175                 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     175                if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    176176                    return;
    177177
     
    182182
    183183                // Iterate over all camera positions and inversely move the camera to create a shrinking sensation.
    184                 const std::list< StrongPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
     184                const std::list<StrongPtr<CameraPosition>>& cameraPositions = pawn->getCameraPositions();
    185185                int size = cameraPositions.size();
    186186                for(int index = 0; index < size; index++)
    187187                {
    188188                    CameraPosition* cameraPos = pawn->getCameraPosition(index);
    189                     if(cameraPos == NULL)
     189                    if(cameraPos == nullptr)
    190190                        continue;
    191191                    cameraPos->setPosition(cameraPos->getPosition()/factor);
     
    201201                //TODO: Deploy particle effect.
    202202                Pawn* pawn = this->carrierToPawnHelper();
    203                 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     203                if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    204204                    return;
    205205
     
    208208
    209209                // Iterate over all camera positions and inversely move the camera to create a shrinking sensation.
    210                 const std::list< StrongPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
     210                const std::list<StrongPtr<CameraPosition>>& cameraPositions = pawn->getCameraPositions();
    211211                int size = cameraPositions.size();
    212212                for(int index = 0; index < size; index++)
    213213                {
    214214                    CameraPosition* cameraPos = pawn->getCameraPosition(index);
    215                     if(cameraPos == NULL)
     215                    if(cameraPos == nullptr)
    216216                        continue;
    217217                    cameraPos->setPosition(cameraPos->getPosition()/this->shrinkFactor_);
     
    237237            {
    238238                Pawn* pawn = this->carrierToPawnHelper();
    239                 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     239                if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    240240                {
    241241                    this->Pickupable::destroy();
     
    263263
    264264                // Iterate over all camera positions and inversely move the camera to create a shrinking sensation.
    265                 const std::list< StrongPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
     265                const std::list<StrongPtr<CameraPosition>>& cameraPositions = pawn->getCameraPositions();
    266266                int size = cameraPositions.size();
    267267                for(int index = 0; index < size; index++)
    268268                {
    269269                    CameraPosition* cameraPos = pawn->getCameraPosition(index);
    270                     if(cameraPos == NULL)
     270                    if(cameraPos == nullptr)
    271271                        continue;
    272272                    cameraPos->setPosition(cameraPos->getPosition()/factor);
     
    277277            {
    278278                Pawn* pawn = this->carrierToPawnHelper();
    279                 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
     279                if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
    280280                    this->Pickupable::destroy();
    281281
     
    304304
    305305                // Iterate over all camera positions and inversely move the camera to create a shrinking sensation.
    306                 const std::list< StrongPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
     306                const std::list<StrongPtr<CameraPosition>>& cameraPositions = pawn->getCameraPositions();
    307307                int size = cameraPositions.size();
    308308                for(int index = 0; index < size; index++)
    309309                {
    310310                    CameraPosition* cameraPos = pawn->getCameraPosition(index);
    311                     if(cameraPos == NULL)
     311                    if(cameraPos == nullptr)
    312312                        continue;
    313313                    cameraPos->setPosition(cameraPos->getPosition()/factor);
  • code/branches/cpp11_v3/src/modules/pickup/items/SpeedPickup.cc

    r9667 r11054  
    9999
    100100        SpaceShip* ship = this->carrierToSpaceShipHelper();
    101         if(ship == NULL) // If the PickupCarrier is no SpaceShip, then this pickup is useless and therefore is destroyed.
     101        if(ship == nullptr) // If the PickupCarrier is no SpaceShip, then this pickup is useless and therefore is destroyed.
    102102            this->Pickupable::destroy();
    103103
     
    143143        Helper to transform the PickupCarrier to a SpaceShip, and throw an error message if the conversion fails.
    144144    @return
    145         A pointer to the SpaceShip, or NULL if the conversion failed.
     145        A pointer to the SpaceShip, or nullptr if the conversion failed.
    146146    */
    147147    SpaceShip* SpeedPickup::carrierToSpaceShipHelper(void)
     
    150150        SpaceShip* ship = orxonox_cast<SpaceShip*>(carrier);
    151151
    152         if(ship == NULL)
     152        if(ship == nullptr)
    153153        {
    154154            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in SpeedPickup." << endl;
Note: See TracChangeset for help on using the changeset viewer.