Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 2, 2008, 9:10:00 PM (16 years ago)
Author:
scheusso
Message:

made some adjustments mostly to the networkid (classid) in order to have it platform independent

Location:
code/branches/network64/src/orxonox/objects
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network64/src/orxonox/objects/Test.cc

    r2245 r2309  
    6161        void Test::setConfigValues()
    6262        {
    63                 SetConfigValue ( v1, 1 )/*.callback ( this, &Test::checkV1 )*/;
    64     SetConfigValue ( v2, 2 )/*.callback ( this, &Test::checkV2 )*/;
    65     SetConfigValue ( v3, 3 )/*.callback ( this, &Test::checkV3 )*/;
    66     SetConfigValue ( v4, 4 )/*.callback ( this, &Test::checkV4 )*/;
     63                SetConfigValue ( u1, 1 )/*.callback ( this, &Test::checkV1 )*/;
     64    SetConfigValue ( u2, 2 )/*.callback ( this, &Test::checkV2 )*/;
     65    SetConfigValue ( u3, 3 )/*.callback ( this, &Test::checkV3 )*/;
     66    SetConfigValue ( u4, 4 )/*.callback ( this, &Test::checkV4 )*/;
     67   
     68    SetConfigValue ( s1, 1 )/*.callback ( this, &Test::checkV1 )*/;
     69    SetConfigValue ( s2, 2 )/*.callback ( this, &Test::checkV2 )*/;
     70    SetConfigValue ( s3, 3 )/*.callback ( this, &Test::checkV3 )*/;
     71    SetConfigValue ( s4, 4 )/*.callback ( this, &Test::checkV4 )*/;
    6772        }
    6873
     
    7075        void Test::registerVariables()
    7176        {
    72                 registerVariable ( v1, variableDirection::toclient, new NetworkCallback<Test> ( this, &Test::checkV1 ));
    73     registerVariable ( v2, variableDirection::toserver, new NetworkCallback<Test> ( this, &Test::checkV2 ));
    74                 registerVariable ( v3, variableDirection::serverMaster, new NetworkCallback<Test> ( this, &Test::checkV3 ), true );
    75     registerVariable ( v4, variableDirection::clientMaster, new NetworkCallback<Test> ( this, &Test::checkV4 ), true );
     77                registerVariable ( u1, variableDirection::toclient, new NetworkCallback<Test> ( this, &Test::checkU1 ));
     78    registerVariable ( u2, variableDirection::toserver, new NetworkCallback<Test> ( this, &Test::checkU2 ));
     79                registerVariable ( u3, variableDirection::serverMaster, new NetworkCallback<Test> ( this, &Test::checkU3 ), true );
     80    registerVariable ( u4, variableDirection::clientMaster, new NetworkCallback<Test> ( this, &Test::checkU4 ), true );
     81   
     82    registerVariable ( s1, variableDirection::toclient, new NetworkCallback<Test> ( this, &Test::checkS1 ));
     83    registerVariable ( s2, variableDirection::toserver, new NetworkCallback<Test> ( this, &Test::checkS2 ));
     84    registerVariable ( s3, variableDirection::serverMaster, new NetworkCallback<Test> ( this, &Test::checkS3 ), true );
     85    registerVariable ( s4, variableDirection::clientMaster, new NetworkCallback<Test> ( this, &Test::checkS4 ), true );
    7686        }
    7787
    78   void Test::checkV1(){
    79     COUT(1) << "V1 changed: " << v1 << std::endl;
    80   }
     88  void Test::checkU1(){ COUT(1) << "U1 changed: " << u1 << std::endl; }
     89  void Test::checkU2(){ COUT(1) << "U2 changed: " << u2 << std::endl; }
     90  void Test::checkU3(){ COUT(1) << "U3 changed: " << u3 << std::endl; }
     91  void Test::checkU4(){ COUT(1) << "U4 changed: " << u4 << std::endl; }
    8192
    82   void Test::checkV2(){
    83     COUT(1) << "V2 changed: " << v2 << std::endl;
    84   }
    85 
    86   void Test::checkV3(){
    87     COUT(1) << "V3 changed: " << v3 << std::endl;
    88   }
    89  
    90   void Test::checkV4(){
    91     COUT(1) << "V4 changed: " << v4 << std::endl;
    92   }
    93 
     93  void Test::checkS1(){ COUT(1) << "S1 changed: " << s1 << std::endl; }
     94  void Test::checkS2(){ COUT(1) << "S2 changed: " << s2 << std::endl; }
     95  void Test::checkS3(){ COUT(1) << "S3 changed: " << s3 << std::endl; }
     96  void Test::checkS4(){ COUT(1) << "S4 changed: " << s4 << std::endl; }
    9497
    9598}
  • code/branches/network64/src/orxonox/objects/Test.h

    r2245 r2309  
    3434#include "network/synchronisable/Synchronisable.h"
    3535
     36
     37typedef int TYPE;
     38typedef unsigned int UTYPE;
     39
     40
    3641namespace orxonox
    3742{
     
    4550      void registerVariables();
    4651
    47       void setV1(unsigned int value){ v1 = value; }
    48       void setV2(unsigned int value){ v2 = value; }
    49       void setV3(unsigned int value){ v3 = value; }
    50       void setV4(unsigned int value){ v4 = value; }
    5152
    52       void checkV1();
    53       void checkV2();
    54       void checkV3();
    55       void checkV4();
     53      //unsigned functions
     54      void setU1(UTYPE value){ u1 = value; }
     55      void setU2(UTYPE value){ u2 = value; }
     56      void setU3(UTYPE value){ u3 = value; }
     57      void setU4(UTYPE value){ u4 = value; }
     58      void checkU1();
     59      void checkU2();
     60      void checkU3();
     61      void checkU4();
    5662     
    57       static void printV1(){ instance_->checkV1(); }
    58       static void printV2(){ instance_->checkV2(); }
    59       static void printV3(){ instance_->checkV3(); }
    60       static void printV4(){ instance_->checkV4(); }
     63      //signed functions
     64      void setS1(TYPE value){ s1 = value; }
     65      void setS2(TYPE value){ s2 = value; }
     66      void setS3(TYPE value){ s3 = value; }
     67      void setS4(TYPE value){ s4 = value; }
     68      void checkS1();
     69      void checkS2();
     70      void checkS3();
     71      void checkS4();
     72     
     73      static void printV1(){ instance_->checkU1(); }
     74      static void printV2(){ instance_->checkU2(); }
     75      static void printV3(){ instance_->checkU3(); }
     76      static void printV4(){ instance_->checkU4(); }
    6177
    6278    private:
    63       unsigned int v1;
    64       unsigned int v2;
    65       unsigned int v3;
    66       unsigned int v4;
     79      UTYPE u1;
     80      UTYPE u2;
     81      UTYPE u3;
     82      UTYPE u4;
     83     
     84      TYPE s1;
     85      TYPE s2;
     86      TYPE s3;
     87      TYPE s4;
    6788     
    6889      static Test* instance_;
Note: See TracChangeset for help on using the changeset viewer.