Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 9, 2015, 2:15:46 PM (9 years ago)
Author:
landauf
Message:

removed changedGametype and getOldGametype from BaseObject. the gametype is never supposed to change anyway. the only exception is PlayerInfo which may change a gametype. but this happens in a completely controlled manner and can be done with a separate new function (switchGametype).

Location:
code/branches/core7/src/libraries/core
Files:
3 edited

Legend:

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

    r10571 r10576  
    6363        this->bActive_ = true;
    6464        this->bVisible_ = true;
    65         this->oldGametype_ = 0;
    6665        this->bRegisteredEventStates_ = false;
    6766
  • code/branches/core7/src/libraries/core/BaseObject.h

    r10571 r10576  
    148148            inline virtual uint32_t getSceneID() const { return this->sceneID_; }
    149149
    150             inline void setGametype(const StrongPtr<Gametype>& gametype)
    151             {
    152                 if (gametype != this->gametype_)
    153                 {
    154                     this->oldGametype_ = this->gametype_;
    155                     this->gametype_ = gametype;
    156                     this->changedGametype();
    157                 }
    158             }
     150            inline void setGametype(const StrongPtr<Gametype>& gametype) { this->gametype_ = gametype; }
    159151            inline Gametype* getGametype() const { return this->gametype_; }
    160             inline Gametype* getOldGametype() const { return this->oldGametype_; }
    161             virtual void changedGametype() {}
    162152
    163153            inline void setLevel(const StrongPtr<Level>& level) { this->level_ = level; }
     
    219209            uint32_t               sceneID_;
    220210            StrongPtr<Gametype>    gametype_;
    221             Gametype*              oldGametype_;
    222211            StrongPtr<Level>       level_;
    223212            std::set<Template*>    templates_;
     
    235224    SUPER_FUNCTION(4, BaseObject, XMLEventPort, false);
    236225    SUPER_FUNCTION(8, BaseObject, changedName, false);
    237     SUPER_FUNCTION(9, BaseObject, changedGametype, false);
    238226}
    239227
  • code/branches/core7/src/libraries/core/class/Super.h

    r9667 r10576  
    274274        SUPER_NOARGS(classname, functionname)
    275275
    276     #define SUPER_changedGametype(classname, functionname, ...) \
    277         SUPER_NOARGS(classname, functionname)
    278 
    279276    #define SUPER_changedUsed(classname, functionname, ...) \
    280277        SUPER_NOARGS(classname, functionname)
     
    555552        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
    556553
    557         SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(9, changedGametype, false)
    558             ()
    559         SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
    560 
    561         SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(10, changedUsed, false)
    562             ()
    563         SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
    564 
    565         SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(11, changedCarrier, false)
    566             ()
    567         SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
    568 
    569         SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(12, changedPickedUp, false)
     554        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(9, changedUsed, false)
     555            ()
     556        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
     557
     558        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(10, changedCarrier, false)
     559            ()
     560        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
     561
     562        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(11, changedPickedUp, false)
    570563            ()
    571564        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
     
    623616    SUPER_INTRUSIVE_DECLARATION(changedOverlayGroup);
    624617    SUPER_INTRUSIVE_DECLARATION(changedName);
    625     SUPER_INTRUSIVE_DECLARATION(changedGametype);
    626618    SUPER_INTRUSIVE_DECLARATION(changedUsed);
    627619    SUPER_INTRUSIVE_DECLARATION(changedCarrier);
Note: See TracChangeset for help on using the changeset viewer.