Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10571 for code/branches/core7


Ignore:
Timestamp:
Sep 9, 2015, 1:11:13 PM (9 years ago)
Author:
landauf
Message:

BaseObject returns plain pointers instead of StrongPtrs for Namespace, Level, Scene, and Gametype.

Location:
code/branches/core7/src
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/libraries/core/BaseObject.cc

    r10358 r10571  
    7878        {
    7979            this->setFile(this->creator_->getFile());
    80             this->setNamespace(this->creator_->getNamespace());
    81             this->setScene(this->creator_->getScene(), this->creator_->getSceneID());
    82             this->setGametype(this->creator_->getGametype());
    83             this->setLevel(this->creator_->getLevel());
     80            this->setNamespace(this->creator_->namespace_);
     81            this->setScene(this->creator_->scene_, this->creator_->sceneID_);
     82            this->setGametype(this->creator_->gametype_);
     83            this->setLevel(this->creator_->level_);
    8484        }
    8585        else
  • code/branches/core7/src/libraries/core/BaseObject.h

    r10570 r10571  
    139139
    140140            inline void setNamespace(const StrongPtr<Namespace>& ns) { this->namespace_ = ns; }
    141             inline const StrongPtr<Namespace>& getNamespace() const { return this->namespace_; }
     141            inline Namespace* getNamespace() const { return this->namespace_; }
    142142
    143143            inline void setCreator(BaseObject* creator) { this->creator_ = creator; }
     
    145145
    146146            inline void setScene(const StrongPtr<Scene>& scene, uint32_t sceneID) { this->scene_ = scene; this->sceneID_=sceneID; }
    147             inline const StrongPtr<Scene>& getScene() const { return this->scene_; }
     147            inline Scene* getScene() const { return this->scene_; }
    148148            inline virtual uint32_t getSceneID() const { return this->sceneID_; }
    149149
     
    157157                }
    158158            }
    159             inline const StrongPtr<Gametype>& getGametype() const { return this->gametype_; }
     159            inline Gametype* getGametype() const { return this->gametype_; }
    160160            inline Gametype* getOldGametype() const { return this->oldGametype_; }
    161161            virtual void changedGametype() {}
    162162
    163163            inline void setLevel(const StrongPtr<Level>& level) { this->level_ = level; }
    164             inline const StrongPtr<Level>& getLevel() const { return this->level_; }
     164            inline Level* getLevel() const { return this->level_; }
    165165
    166166            void addEventSource(BaseObject* source, const std::string& state);
  • code/branches/core7/src/modules/dodgerace/DodgeRaceCenterPoint.cc

    r10232 r10571  
    6666        if (this->getGametype() != NULL && this->getGametype()->isA(Class(DodgeRace)))
    6767        {
    68             DodgeRace* DodgeRaceGametype = orxonox_cast<DodgeRace*>(this->getGametype().get());
     68            DodgeRace* DodgeRaceGametype = orxonox_cast<DodgeRace*>(this->getGametype());
    6969            DodgeRaceGametype->setCenterpoint(this);
    7070        }
  • code/branches/core7/src/modules/dodgerace/DodgeRaceHUDinfo.cc

    r10236 r10571  
    8282        if (this->getOwner() && this->getOwner()->getGametype())
    8383        {
    84             this->DodgeRaceGame = orxonox_cast<DodgeRace*>(this->getOwner()->getGametype().get());
     84            this->DodgeRaceGame = orxonox_cast<DodgeRace*>(this->getOwner()->getGametype());
    8585        }
    8686        else
  • code/branches/core7/src/modules/gametypes/OldRaceCheckPoint.cc

    r9667 r10571  
    6161        SUPER(OldRaceCheckPoint, tick, dt);
    6262
    63         OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype().get());
     63        OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype());
    6464        assert(gametype);
    6565        if (this->getCheckpointIndex() == gametype->getCheckpointsReached())
     
    8282        DistanceTrigger::triggered(bIsTriggered);
    8383
    84         OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype().get());
     84        OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype());
    8585        if (gametype && this->getCheckpointIndex() == gametype->getCheckpointsReached() && bIsTriggered)
    8686        {
     
    107107        if (this->bTimeLimit_ != 0)
    108108        {
    109             OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype().get());
     109            OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype());
    110110            if (gametype)
    111111            {
  • code/branches/core7/src/modules/gametypes/SpaceRaceManager.cc

    r9667 r10571  
    4646    {
    4747        RegisterObject(SpaceRaceManager);
    48         this->race_ = orxonox_cast<SpaceRace*>(this->getGametype().get());
     48        this->race_ = orxonox_cast<SpaceRace*>(this->getGametype());
    4949        assert(race_);
    5050        //amountOfPlayers=(race_->getPlayers()).size();
     
    139139    void SpaceRaceManager::checkpointReached(RaceCheckPoint* newCheckpoint, PlayerInfo* player)
    140140    {
    141         SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
     141        SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype());
    142142        assert(gametype);
    143143        if (!gametype)
  • code/branches/core7/src/modules/invader/InvaderCenterPoint.cc

    r9943 r10571  
    6666        if (this->getGametype() != NULL && this->getGametype()->isA(Class(Invader)))
    6767        {
    68             Invader* InvaderGametype = orxonox_cast<Invader*>(this->getGametype().get());
     68            Invader* InvaderGametype = orxonox_cast<Invader*>(this->getGametype());
    6969            InvaderGametype->setCenterpoint(this);
    7070        }
  • code/branches/core7/src/modules/invader/InvaderHUDinfo.cc

    r9961 r10571  
    128128        if (this->getOwner() && this->getOwner()->getGametype())
    129129        {
    130             this->InvaderGame = orxonox_cast<Invader*>(this->getOwner()->getGametype().get());
     130            this->InvaderGame = orxonox_cast<Invader*>(this->getOwner()->getGametype());
    131131        }
    132132        else
  • code/branches/core7/src/modules/jump/JumpCenterpoint.cc

    r10262 r10571  
    9191        if (getGametype() != NULL && this->getGametype()->isA(Class(Jump)))
    9292        {
    93             Jump* jumpGametype = orxonox_cast<Jump*>(this->getGametype().get());
     93            Jump* jumpGametype = orxonox_cast<Jump*>(this->getGametype());
    9494            jumpGametype->setCenterpoint(this);
    9595        }
  • code/branches/core7/src/modules/jump/JumpScore.cc

    r10262 r10571  
    119119        if (this->getOwner() != NULL && this->getOwner()->getGametype())
    120120        {
    121             this->owner_ = orxonox_cast<Jump*>(this->getOwner()->getGametype().get());
     121            this->owner_ = orxonox_cast<Jump*>(this->getOwner()->getGametype());
    122122        }
    123123        else
  • code/branches/core7/src/modules/mini4dgame/Mini4DgameBoard.cc

    r10230 r10571  
    919919        if (this->getGametype() != NULL && this->getGametype()->isA(Class(Mini4Dgame)))
    920920        {
    921             Mini4Dgame* Mini4DgameGametype = orxonox_cast<Mini4Dgame*>(this->getGametype().get());
     921            Mini4Dgame* Mini4DgameGametype = orxonox_cast<Mini4Dgame*>(this->getGametype());
    922922            Mini4DgameGametype->setGameboard(this);
    923923        }
  • code/branches/core7/src/modules/objects/triggers/CheckPoint.cc

    r9667 r10571  
    9393        DistanceTrigger::triggered(bIsTriggered);
    9494
    95         Asteroids* gametype = orxonox_cast<Asteroids*>(this->getGametype().get());
     95        Asteroids* gametype = orxonox_cast<Asteroids*>(this->getGametype());
    9696        if (gametype)
    9797        {
  • code/branches/core7/src/modules/overlays/hud/LastManStandingInfos.cc

    r9667 r10571  
    8787        {
    8888            this->player_ = orxonox_cast<PlayerInfo*>(this->getOwner());
    89             this->lms_ = orxonox_cast<LastManStanding*>(this->getOwner()->getGametype().get());
     89            this->lms_ = orxonox_cast<LastManStanding*>(this->getOwner()->getGametype());
    9090        }
    9191        else
  • code/branches/core7/src/modules/overlays/hud/LastTeamStandingInfos.cc

    r9667 r10571  
    8787        {
    8888            this->player_ = orxonox_cast<PlayerInfo*>(this->getOwner());
    89             this->lts_ = orxonox_cast<LastTeamStanding*>(this->getOwner()->getGametype().get());
     89            this->lts_ = orxonox_cast<LastTeamStanding*>(this->getOwner()->getGametype());
    9090        }
    9191        else
  • code/branches/core7/src/modules/overlays/hud/TeamBaseMatchScore.cc

    r9667 r10571  
    118118
    119119        if (this->getOwner() && this->getOwner()->getGametype())
    120             this->owner_ = orxonox_cast<TeamBaseMatch*>(this->getOwner()->getGametype().get());
     120            this->owner_ = orxonox_cast<TeamBaseMatch*>(this->getOwner()->getGametype());
    121121        else
    122122            this->owner_ = 0;
  • code/branches/core7/src/modules/pong/PongCenterpoint.cc

    r9667 r10571  
    9898        if (this->getGametype() != NULL && this->getGametype()->isA(Class(Pong)))
    9999        {
    100             Pong* pongGametype = orxonox_cast<Pong*>(this->getGametype().get());
     100            Pong* pongGametype = orxonox_cast<Pong*>(this->getGametype());
    101101            pongGametype->setCenterpoint(this);
    102102        }
  • code/branches/core7/src/modules/pong/PongScore.cc

    r9939 r10571  
    170170
    171171        if (this->getOwner() != NULL && this->getOwner()->getGametype())
    172             this->owner_ = orxonox_cast<Pong*>(this->getOwner()->getGametype().get());
     172            this->owner_ = orxonox_cast<Pong*>(this->getOwner()->getGametype());
    173173        else
    174174            this->owner_ = 0;
  • code/branches/core7/src/modules/tetris/TetrisBrick.cc

    r10262 r10571  
    169169        if (this->getGametype() != NULL && this->getGametype()->isA(Class(Tetris)))
    170170        {
    171             Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype().get());
     171            Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype());
    172172            return tetrisGametype;
    173173        }
  • code/branches/core7/src/modules/tetris/TetrisCenterpoint.cc

    r9667 r10571  
    9898        if (this->getGametype() != NULL && this->getGametype()->isA(Class(Tetris)))
    9999        {
    100             Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype().get());
     100            Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype());
    101101            tetrisGametype->setCenterpoint(this);
    102102        }
  • code/branches/core7/src/modules/tetris/TetrisScore.cc

    r10262 r10571  
    118118
    119119        if (this->getOwner() != NULL && this->getOwner()->getGametype())
    120             this->owner_ = orxonox_cast<Tetris*>(this->getOwner()->getGametype().get());
     120            this->owner_ = orxonox_cast<Tetris*>(this->getOwner()->getGametype());
    121121        else
    122122            this->owner_ = 0;
  • code/branches/core7/src/modules/towerdefense/TowerDefenseCenterpoint.cc

    r9667 r10571  
    103103        {
    104104            // Sets the centerpoint of the gametype. The gametype uses this to later spawn in towers, he needs the tower template stored in the center point
    105             TowerDefense* towerDefenseGametype = orxonox_cast<TowerDefense*>(this->getGametype().get());
     105            TowerDefense* towerDefenseGametype = orxonox_cast<TowerDefense*>(this->getGametype());
    106106            towerDefenseGametype->setCenterpoint(this);
    107107        }
  • code/branches/core7/src/modules/towerdefense/TowerDefenseEnemy.cc

    r10557 r10571  
    2929        this->setCollisionType(WorldEntity::Dynamic);
    3030        //needed to keep track of the PlayerStats coded in TowerDefense.h
    31         this->td = orxonox_cast<TowerDefense*>(this->getGametype().get());
     31        this->td = orxonox_cast<TowerDefense*>(this->getGametype());
    3232        once_=false;
    3333
  • code/branches/core7/src/modules/towerdefense/TowerDefenseHUDController.cc

    r10258 r10571  
    8080            if (this->getOwner() && this->getOwner()->getGametype())
    8181                    {
    82                         this->td = orxonox_cast<TowerDefense*>(this->getOwner()->getGametype().get());
     82                        this->td = orxonox_cast<TowerDefense*>(this->getOwner()->getGametype());
    8383                    }
    8484                    else
  • code/branches/core7/src/orxonox/Scene.cc

    r10570 r10571  
    6363
    6464        this->setScene(StrongPtr<Scene>(this, false), this->getObjectID());
     65
    6566        this->bShadows_ = true;
    6667        this->bDebugDrawPhysics_ = false;
  • code/branches/core7/src/orxonox/overlays/OverlayGroup.cc

    r10560 r10571  
    3838#include "core/command/ConsoleCommandIncludes.h"
    3939#include "OrxonoxOverlay.h"
     40#include "gametypes/Gametype.h"
    4041
    4142namespace orxonox
  • code/branches/core7/src/orxonox/worldentities/pawns/Destroyer.cc

    r9667 r10571  
    4040        RegisterObject(Destroyer);
    4141
    42         UnderAttack* gametype = orxonox_cast<UnderAttack*>(this->getGametype().get());
     42        UnderAttack* gametype = orxonox_cast<UnderAttack*>(this->getGametype());
    4343        if (gametype)
    4444        {
  • code/branches/core7/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc

    r9667 r10571  
    4545        this->state_ = BaseState::Uncontrolled;
    4646
    47         TeamBaseMatch* gametype = orxonox_cast<TeamBaseMatch*>(this->getGametype().get());
     47        TeamBaseMatch* gametype = orxonox_cast<TeamBaseMatch*>(this->getGametype());
    4848        if (gametype)
    4949        {
     
    5858        this->fireEvent();
    5959
    60         TeamDeathmatch* gametype = orxonox_cast<TeamDeathmatch*>(this->getGametype().get());
     60        TeamDeathmatch* gametype = orxonox_cast<TeamDeathmatch*>(this->getGametype());
    6161        if (!gametype)
    6262            return;
Note: See TracChangeset for help on using the changeset viewer.