Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 31, 2010, 3:37:40 AM (14 years ago)
Author:
landauf
Message:

merged consolecommands3 branch back to trunk.

note: the console command interface has changed completely, but the documentation is not yet up to date. just copy an existing command and change it to your needs, it's pretty self-explanatory. also the include files related to console commands are now located in core/command/. in the game it should work exactly like before, except for some changes in the auto-completion.

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/network/NetworkFunction.h

    r6417 r7284  
    3939#include <boost/static_assert.hpp>
    4040
    41 #include "core/Functor.h"
    4241#include "core/Identifier.h"
     42#include "core/command/Functor.h"
    4343#include "FunctionCallManager.h"
    4444#include "synchronisable/Synchronisable.h"
     
    102102class _NetworkExport NetworkFunctionStatic: public NetworkFunctionBase {
    103103  public:
    104     NetworkFunctionStatic(FunctorStatic* functor, const std::string& name, const NetworkFunctionPointer& p);
    105     ~NetworkFunctionStatic();
     104    NetworkFunctionStatic(const FunctorStaticPtr& functor, const std::string& name, const NetworkFunctionPointer& p);
    106105
    107106    inline void call(){ (*this->functor_)(); }
     
    124123    static std::map<NetworkFunctionPointer, NetworkFunctionStatic*>& getFunctorMap();
    125124    static std::map<uint32_t, NetworkFunctionStatic*>& getIdMap();
    126     FunctorStatic* functor_;
     125    FunctorStaticPtr functor_;
    127126
    128127};
     
    155154template <class T> class NetworkMemberFunction: public NetworkMemberFunctionBase {
    156155  public:
    157     NetworkMemberFunction(FunctorMember<T>* functor, const std::string& name, const NetworkFunctionPointer& p);
    158     ~NetworkMemberFunction();
     156    NetworkMemberFunction(const FunctorMemberPtr<T>& functor, const std::string& name, const NetworkFunctionPointer& p);
    159157
    160158    inline void call(uint32_t objectID)
     
    190188
    191189  private:
    192     FunctorMember<T>* functor_;
    193 };
    194 
    195 template <class T> NetworkMemberFunction<T>::NetworkMemberFunction(FunctorMember<T>* functor, const std::string& name, const NetworkFunctionPointer& p):
     190    FunctorMemberPtr<T> functor_;
     191};
     192
     193template <class T> NetworkMemberFunction<T>::NetworkMemberFunction(const FunctorMemberPtr<T>& functor, const std::string& name, const NetworkFunctionPointer& p):
    196194    NetworkMemberFunctionBase(name, p), functor_(functor)
    197195{
    198 }
    199 template <class T> NetworkMemberFunction<T>::~NetworkMemberFunction()
    200 {
    201   delete this->functor_;
    202196}
    203197
Note: See TracChangeset for help on using the changeset viewer.