Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 9, 2013, 9:26:46 PM (11 years ago)
Author:
landauf
Message:

BaseObject now requires a Context instead of a creator (BaseObject*) in its constructor.
Namespace, Level, and Scene inherit from Context

Location:
code/branches/core6/src/orxonox/worldentities
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core6/src/orxonox/worldentities/BigExplosion.cc

    r9589 r9629  
    4343    CreateFactory(BigExplosion);
    4444
    45     BigExplosion::BigExplosion(BaseObject* creator) : StaticEntity(creator)
     45    BigExplosion::BigExplosion(Context* context) : StaticEntity(context)
    4646    {
    4747        RegisterObject(BigExplosion);
     
    8080    void BigExplosion::init()
    8181    {
    82         this->debrisEntity1_ = new MovableEntity(this);
    83         this->debrisEntity2_ = new MovableEntity(this);
    84         this->debrisEntity3_ = new MovableEntity(this);
    85         this->debrisEntity4_ = new MovableEntity(this);
     82        this->debrisEntity1_ = new MovableEntity(this->getContext());
     83        this->debrisEntity2_ = new MovableEntity(this->getContext());
     84        this->debrisEntity3_ = new MovableEntity(this->getContext());
     85        this->debrisEntity4_ = new MovableEntity(this->getContext());
    8686
    8787        this->debrisEntity1_->setSyncMode(0);
     
    9090        this->debrisEntity4_->setSyncMode(0);
    9191
    92         this->debris1_ = new Model(this);
    93         this->debris2_ = new Model(this);
    94         this->debris3_ = new Model(this);
    95         this->debris4_ = new Model(this);
     92        this->debris1_ = new Model(this->getContext());
     93        this->debris2_ = new Model(this->getContext());
     94        this->debris3_ = new Model(this->getContext());
     95        this->debris4_ = new Model(this->getContext());
    9696
    9797        this->debris1_->setSyncMode(0);
     
    100100        this->debris4_->setSyncMode(0);
    101101
    102         this->explosion_ = new StaticEntity(this);
     102        this->explosion_ = new StaticEntity(this->getContext());
    103103        this->explosion_->setSyncMode(0);
    104104
     
    148148        this->debrisEntity4_->attach(debris4_);
    149149
    150         ParticleSpawner* effect = new ParticleSpawner(this->getCreator());
     150        ParticleSpawner* effect = new ParticleSpawner(this->getContext());
    151151        effect->setDestroyAfterLife(true);
    152152        effect->setSource("Orxonox/explosion2b");
     
    154154        effect->setSyncMode(0);
    155155
    156         ParticleSpawner* effect2 = new ParticleSpawner(this->getCreator());
     156        ParticleSpawner* effect2 = new ParticleSpawner(this->getContext());
    157157        effect2->setDestroyAfterLife(true);
    158158        effect2->setSource("Orxonox/smoke6");
     
    172172        for(int i=0;i<10;i++)
    173173        {
    174             Model* part1 = new Model(this);
    175             Model* part2 = new Model(this);
    176 
    177             MovableEntity* partEntity1 = new MovableEntity(this);
    178             MovableEntity* partEntity2 = new MovableEntity(this);
     174            Model* part1 = new Model(this->getContext());
     175            Model* part2 = new Model(this->getContext());
     176
     177            MovableEntity* partEntity1 = new MovableEntity(this->getContext());
     178            MovableEntity* partEntity2 = new MovableEntity(this->getContext());
    179179
    180180            part1->setSyncMode(0);
  • code/branches/core6/src/orxonox/worldentities/BigExplosion.h

    r7176 r9629  
    4040    {
    4141        public:
    42             BigExplosion(BaseObject* creator);
     42            BigExplosion(Context* context);
    4343            virtual ~BigExplosion();
    4444
  • code/branches/core6/src/orxonox/worldentities/CameraPosition.cc

    r8706 r9629  
    3737    CreateFactory(CameraPosition);
    3838
    39     CameraPosition::CameraPosition(BaseObject* creator) : StaticEntity(creator)
     39    CameraPosition::CameraPosition(Context* context) : StaticEntity(context)
    4040    {
    4141        RegisterObject(CameraPosition);
  • code/branches/core6/src/orxonox/worldentities/CameraPosition.h

    r5781 r9629  
    3838    {
    3939        public:
    40             CameraPosition(BaseObject* creator);
     40            CameraPosition(Context* context);
    4141            virtual ~CameraPosition();
    4242
  • code/branches/core6/src/orxonox/worldentities/ControllableEntity.cc

    r9558 r9629  
    5252    registerMemberNetworkFunction( ControllableEntity, setTargetInternal );
    5353
    54     ControllableEntity::ControllableEntity(BaseObject* creator) : MobileEntity(creator)
     54    ControllableEntity::ControllableEntity(Context* context) : MobileEntity(context)
    5555    {
    5656        RegisterObject(ControllableEntity);
     
    397397        if (!this->camera_ && GameMode::showsGraphics())
    398398        {
    399             this->camera_ = new Camera(this);
     399            this->camera_ = new Camera(this->getContext());
    400400            this->camera_->requestFocus();
    401401            if (!this->cameraPositionTemplate_.empty())
     
    423423            if (!this->hudtemplate_.empty())
    424424            {
    425                 this->hud_ = new OverlayGroup(this);
     425                this->hud_ = new OverlayGroup(this->getContext());
    426426                this->hud_->addTemplate(this->hudtemplate_);
    427427                this->hud_->setOwner(this);
  • code/branches/core6/src/orxonox/worldentities/ControllableEntity.h

    r9348 r9629  
    4444
    4545        public:
    46             ControllableEntity(BaseObject* creator);
     46            ControllableEntity(Context* context);
    4747            virtual ~ControllableEntity();
    4848
  • code/branches/core6/src/orxonox/worldentities/Drone.cc

    r7163 r9629  
    3939        Constructor. Registers the object and initializes some default values.
    4040    */
    41     Drone::Drone(BaseObject* creator) : Pawn(creator)
     41    Drone::Drone(Context* context) : Pawn(context)
    4242    {
    4343        RegisterObject(Drone);
     
    5050        this->setCollisionType(WorldEntity::Dynamic);
    5151
    52         myController_ = new DroneController(static_cast<BaseObject*>(this)); //!< Creates a new controller and passes our this pointer to it as creator.
     52        myController_ = new DroneController(this->getContext()); //!< Creates a new controller and passes our this pointer to it as creator.
    5353        myController_->setDrone(this);
    5454
  • code/branches/core6/src/orxonox/worldentities/Drone.h

    r7163 r9629  
    4747    {
    4848        public:
    49             Drone(BaseObject* creator);
     49            Drone(Context* context);
    5050            virtual ~Drone();
    5151
  • code/branches/core6/src/orxonox/worldentities/EffectContainer.cc

    r6417 r9629  
    4242    CreateFactory(EffectContainer);
    4343
    44     EffectContainer::EffectContainer(BaseObject* creator)
    45         : BaseObject(creator)
     44    EffectContainer::EffectContainer(Context* context)
     45        : BaseObject(context)
    4646        , lua_(NULL)
    4747    {
  • code/branches/core6/src/orxonox/worldentities/EffectContainer.h

    r6417 r9629  
    4040    {
    4141        public:
    42             EffectContainer(BaseObject* creator);
     42            EffectContainer(Context* context);
    4343            virtual ~EffectContainer();
    4444
  • code/branches/core6/src/orxonox/worldentities/ExplosionChunk.cc

    r9589 r9629  
    4040    CreateFactory(ExplosionChunk);
    4141
    42     ExplosionChunk::ExplosionChunk(BaseObject* creator) : MovableEntity(creator)
     42    ExplosionChunk::ExplosionChunk(Context* context) : MovableEntity(context)
    4343    {
    4444        RegisterObject(ExplosionChunk);
  • code/branches/core6/src/orxonox/worldentities/ExplosionChunk.h

    r7163 r9629  
    4040    {
    4141        public:
    42             ExplosionChunk(BaseObject* creator);
     42            ExplosionChunk(Context* context);
    4343            virtual ~ExplosionChunk();
    4444
  • code/branches/core6/src/orxonox/worldentities/MobileEntity.cc

    r8858 r9629  
    3939namespace orxonox
    4040{
    41     MobileEntity::MobileEntity(BaseObject* creator) : WorldEntity(creator)
     41    MobileEntity::MobileEntity(Context* context) : WorldEntity(context)
    4242    {
    4343        RegisterObject(MobileEntity);
  • code/branches/core6/src/orxonox/worldentities/MobileEntity.h

    r8727 r9629  
    4141    {
    4242        public:
    43             MobileEntity(BaseObject* creator);
     43            MobileEntity(Context* context);
    4444            virtual ~MobileEntity();
    4545
  • code/branches/core6/src/orxonox/worldentities/MovableEntity.cc

    r7284 r9629  
    4343    CreateFactory(MovableEntity);
    4444
    45     MovableEntity::MovableEntity(BaseObject* creator) : MobileEntity(creator)
     45    MovableEntity::MovableEntity(Context* context) : MobileEntity(context)
    4646    {
    4747        RegisterObject(MovableEntity);
  • code/branches/core6/src/orxonox/worldentities/MovableEntity.h

    r7163 r9629  
    4343    {
    4444        public:
    45             MovableEntity(BaseObject* creator);
     45            MovableEntity(Context* context);
    4646            virtual ~MovableEntity();
    4747
  • code/branches/core6/src/orxonox/worldentities/SpawnPoint.cc

    r8858 r9629  
    3939    CreateFactory(SpawnPoint);
    4040
    41     SpawnPoint::SpawnPoint(BaseObject* creator) : StaticEntity(creator)
     41    SpawnPoint::SpawnPoint(Context* context) : StaticEntity(context)
    4242    {
    4343        RegisterObject(SpawnPoint);
     
    8181    Pawn* SpawnPoint::spawn()
    8282    {
    83         Pawn* entity = this->spawnclass_.fabricate(this);
     83        Pawn* entity = this->spawnclass_.fabricate(this->getContext());
    8484        if (entity)
    8585        {
  • code/branches/core6/src/orxonox/worldentities/SpawnPoint.h

    r9563 r9629  
    4141    {
    4242        public:
    43             SpawnPoint(BaseObject* creator);
     43            SpawnPoint(Context* context);
    4444            virtual ~SpawnPoint() {}
    4545
  • code/branches/core6/src/orxonox/worldentities/StaticEntity.cc

    r8858 r9629  
    3939    CreateFactory(StaticEntity);
    4040
    41     StaticEntity::StaticEntity(BaseObject* creator) : WorldEntity(creator)
     41    StaticEntity::StaticEntity(Context* context) : WorldEntity(context)
    4242    {
    4343        RegisterObject(StaticEntity);
  • code/branches/core6/src/orxonox/worldentities/StaticEntity.h

    r7163 r9629  
    3939    {
    4040        public:
    41             StaticEntity(BaseObject* creator);
     41            StaticEntity(Context* context);
    4242            virtual ~StaticEntity();
    4343
  • code/branches/core6/src/orxonox/worldentities/TeamSpawnPoint.cc

    r5781 r9629  
    3636    CreateFactory(TeamSpawnPoint);
    3737
    38     TeamSpawnPoint::TeamSpawnPoint(BaseObject* creator) : SpawnPoint(creator)
     38    TeamSpawnPoint::TeamSpawnPoint(Context* context) : SpawnPoint(context)
    3939    {
    4040        RegisterObject(TeamSpawnPoint);
  • code/branches/core6/src/orxonox/worldentities/TeamSpawnPoint.h

    r5781 r9629  
    4040    {
    4141        public:
    42             TeamSpawnPoint(BaseObject* creator);
     42            TeamSpawnPoint(Context* context);
    4343            virtual ~TeamSpawnPoint() {}
    4444
  • code/branches/core6/src/orxonox/worldentities/WorldEntity.cc

    r9612 r9629  
    6666        All the default values are being set here.
    6767    */
    68     WorldEntity::WorldEntity(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
     68    WorldEntity::WorldEntity(Context* context) : BaseObject(context), Synchronisable(context)
    6969    {
    7070        RegisterObject(WorldEntity);
     
    9292        this->bPhysicsActiveSynchronised_    = false;
    9393        this->bPhysicsActiveBeforeAttaching_ = false;
    94         this->collisionShape_ = new WorldEntityCollisionShape(this);
     94        this->collisionShape_ = new WorldEntityCollisionShape(this->getContext());
    9595        this->collisionShape_->setWorldEntityOwner(this);
    9696        this->collisionType_             = None;
  • code/branches/core6/src/orxonox/worldentities/WorldEntity.h

    r7910 r9629  
    9090
    9191        public:
    92             WorldEntity(BaseObject* creator);
     92            WorldEntity(Context* context);
    9393            virtual ~WorldEntity();
    9494
  • code/branches/core6/src/orxonox/worldentities/pawns/Destroyer.cc

    r5929 r9629  
    3636    CreateFactory(Destroyer);
    3737
    38     Destroyer::Destroyer(BaseObject* creator) : SpaceShip(creator)
     38    Destroyer::Destroyer(Context* context) : SpaceShip(context)
    3939    {
    4040        RegisterObject(Destroyer);
  • code/branches/core6/src/orxonox/worldentities/pawns/Destroyer.h

    r5781 r9629  
    3939    {
    4040        public:
    41             Destroyer(BaseObject* creator);
     41            Destroyer(Context* context);
    4242            virtual ~Destroyer() {};
    4343
  • code/branches/core6/src/orxonox/worldentities/pawns/FpsPlayer.cc

    r9558 r9629  
    5555    CreateFactory(FpsPlayer);
    5656
    57     FpsPlayer::FpsPlayer(BaseObject* creator) : Pawn(creator)
     57    FpsPlayer::FpsPlayer(Context* context) : Pawn(context)
    5858    {
    5959        RegisterObject(FpsPlayer);
  • code/branches/core6/src/orxonox/worldentities/pawns/FpsPlayer.h

    r9016 r9629  
    4343    {
    4444        public:
    45             FpsPlayer(BaseObject* creator);
     45            FpsPlayer(Context* context);
    4646            virtual ~FpsPlayer();
    4747
  • code/branches/core6/src/orxonox/worldentities/pawns/Pawn.cc

    r9554 r9629  
    5151    CreateFactory(Pawn);
    5252
    53     Pawn::Pawn(BaseObject* creator)
    54         : ControllableEntity(creator)
    55         , RadarViewable(creator, static_cast<WorldEntity*>(this))
     53    Pawn::Pawn(Context* context)
     54        : ControllableEntity(context)
     55        , RadarViewable(this, static_cast<WorldEntity*>(this))
    5656    {
    5757        RegisterObject(Pawn);
     
    8484        if (GameMode::isMaster())
    8585        {
    86             this->weaponSystem_ = new WeaponSystem(this);
     86            this->weaponSystem_ = new WeaponSystem(this->getContext());
    8787            this->weaponSystem_->setPawn(this);
    8888        }
     
    297297        if (!this->spawnparticlesource_.empty())
    298298        {
    299             ParticleSpawner* effect = new ParticleSpawner(this->getCreator());
     299            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
    300300            effect->setPosition(this->getPosition());
    301301            effect->setOrientation(this->getOrientation());
     
    334334        this->setDestroyWhenPlayerLeft(false);
    335335
    336         BigExplosion* chunk = new BigExplosion(this->getCreator());
     336        BigExplosion* chunk = new BigExplosion(this->getContext());
    337337        chunk->setPosition(this->getPosition());
    338338
     
    342342        // play death effect
    343343        {
    344             ParticleSpawner* effect = new ParticleSpawner(this->getCreator());
     344            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
    345345            effect->setPosition(this->getPosition());
    346346            effect->setOrientation(this->getOrientation());
     
    350350        }
    351351        {
    352             ParticleSpawner* effect = new ParticleSpawner(this->getCreator());
     352            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
    353353            effect->setPosition(this->getPosition());
    354354            effect->setOrientation(this->getOrientation());
     
    358358        }
    359359        {
    360             ParticleSpawner* effect = new ParticleSpawner(this->getCreator());
     360            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
    361361            effect->setPosition(this->getPosition());
    362362            effect->setOrientation(this->getOrientation());
     
    367367        for (unsigned int i = 0; i < this->numexplosionchunks_; ++i)
    368368        {
    369             ExplosionChunk* chunk = new ExplosionChunk(this->getCreator());
     369            ExplosionChunk* chunk = new ExplosionChunk(this->getContext());
    370370            chunk->setPosition(this->getPosition());
    371371        }
  • code/branches/core6/src/orxonox/worldentities/pawns/Pawn.h

    r9348 r9629  
    4545
    4646        public:
    47             Pawn(BaseObject* creator);
     47            Pawn(Context* context);
    4848            virtual ~Pawn();
    4949
  • code/branches/core6/src/orxonox/worldentities/pawns/SpaceShip.cc

    r9589 r9629  
    4848    CreateFactory(SpaceShip);
    4949
    50     SpaceShip::SpaceShip(BaseObject* creator) : Pawn(creator), boostBlur_(NULL)
     50    SpaceShip::SpaceShip(Context* context) : Pawn(context), boostBlur_(NULL)
    5151    {
    5252        RegisterObject(SpaceShip);
  • code/branches/core6/src/orxonox/worldentities/pawns/SpaceShip.h

    r8727 r9629  
    8888    {
    8989        public:
    90             SpaceShip(BaseObject* creator);
     90            SpaceShip(Context* context);
    9191            virtual ~SpaceShip();
    9292
  • code/branches/core6/src/orxonox/worldentities/pawns/Spectator.cc

    r9558 r9629  
    4747    CreateFactory(Spectator);
    4848
    49     Spectator::Spectator(BaseObject* creator) : ControllableEntity(creator)
     49    Spectator::Spectator(Context* context) : ControllableEntity(context)
    5050    {
    5151        RegisterObject(Spectator);
  • code/branches/core6/src/orxonox/worldentities/pawns/Spectator.h

    r7862 r9629  
    4040    {
    4141        public:
    42             Spectator(BaseObject* creator);
     42            Spectator(Context* context);
    4343            virtual ~Spectator();
    4444
  • code/branches/core6/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc

    r5929 r9629  
    3939    CreateFactory(TeamBaseMatchBase);
    4040
    41     TeamBaseMatchBase::TeamBaseMatchBase(BaseObject* creator) : Pawn(creator)
     41    TeamBaseMatchBase::TeamBaseMatchBase(Context* context) : Pawn(context)
    4242    {
    4343        RegisterObject(TeamBaseMatchBase);
  • code/branches/core6/src/orxonox/worldentities/pawns/TeamBaseMatchBase.h

    r5781 r9629  
    5050    {
    5151        public:
    52             TeamBaseMatchBase(BaseObject* creator);
     52            TeamBaseMatchBase(Context* context);
    5353
    5454            // if class closes, close everything
Note: See TracChangeset for help on using the changeset viewer.