Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5634 in orxonox.OLD


Ignore:
Timestamp:
Nov 18, 2005, 6:09:01 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: Executor works just fine.
Changed: Paramerte* to MT_*, to make things more general

Location:
trunk/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/defs/class_id.h

    r5458 r5634  
    213213  CL_TRACK_ELEMENT              =    0x00000b0b,
    214214  CL_NUMBER                     =    0x00000b0c,
     215  CL_EXECUTOR                   =    0x00000b0d,
    215216  CL_FAST_FACTORY               =    0x00000c01,
    216217  CL_SHELL                      =    0x00000c10,
  • trunk/src/defs/functor_list.h

    r5391 r5634  
    3030//! defines the maximum count of arguments function pointers might have
    3131#define FUNCTOR_MAX_ARGUMENTS                5
    32 
    33 typedef enum
    34 {
    35   ParameterNull    = 0,
    36   ParameterBool    = 1,
    37   ParameterChar    = 2,
    38   ParameterString  = 4,
    39   ParameterInt     = 8,
    40   ParameterUInt    = 16,
    41   ParameterFloat   = 32,
    42   ParameterLong    = 64,
    43   ParameterXML     = 128,
    44   /* ... */
    45 } ParameterType;
    46 
     32#include "multi_type.h"
    4733
    4834#define l_BOOL_TYPE        bool                 //!< The type of an BOOL
    4935#define l_BOOL_FUNC        isBool               //!< The function to call to parse BOOL
    5036#define l_BOOL_NAME        "bool"               //!< The name of an BOOL
    51 #define l_BOOL_PARAM       ParameterBool        //!< the type of the parameter BOOL
     37#define l_BOOL_PARAM       MT_BOOL              //!< the type of the parameter BOOL
    5238#define l_BOOL_DEFAULT     false                //!< a default Value for an BOOL
    5339
     
    5642#define l_INT_FUNC         isInt                //!< The function to call to parse INT
    5743#define l_INT_NAME         "int"                //!< The name of an INT
    58 #define l_INT_PARAM        ParameterInt         //!< the type of the parameter INT
     44#define l_INT_PARAM        MT_INT               //!< the type of the parameter INT
    5945#define l_INT_DEFAULT      0                    //!< a default Value for an INT
    6046
     
    6248#define l_UINT_FUNC        isInt                //!< The function to call to parse UINT
    6349#define l_UINT_NAME        "unsigned int"       //!< The name of an UINT
    64 #define l_UINT_PARAM        ParameterUInt       //!< the type of the parameter UINT
     50#define l_UINT_PARAM       MT_INT        //!< the type of the parameter UINT
    6551#define l_UINT_DEFAULT     0                    //!< a default Value for an UINT
    6652
     
    6854#define l_LONG_FUNC        isInt                //!< The function to parse a LONG
    6955#define l_LONG_NAME        "long"               //!< The name of a LONG
    70 #define l_LONG_PARAM       ParameterLong        //!< the type of the parameter LONG
     56#define l_LONG_PARAM       MT_INT //!< the type of the parameter LONG
    7157#define l_LONG_DEFAULT     0                    //!< a default Value for a LONG
    7258
     
    8066#define l_FLOAT_FUNC       isFloat              //!< The function to parse a FLOAT
    8167#define l_FLOAT_NAME       "float"              //!< The name of a FLOAT
    82 #define l_FLOAT_PARAM      ParameterFloat       //!< the type of the parameter FLOAT
     68#define l_FLOAT_PARAM      MT_FLOAT             //!< the type of the parameter FLOAT
    8369#define l_FLOAT_DEFAULT    0.0                  //!< a default Value for a FLOAT
    8470
     
    9177#define l_STRING_FUNC      isString             //!< The function to parse a STRING
    9278#define l_STRING_NAME      "string"             //!< The name of a STRING
    93 #define l_STRING_PARAM     ParameterString      //!< the type of the parameter STRING
     79#define l_STRING_PARAM     MT_STRING            //!< the type of the parameter STRING
    9480#define l_STRING_DEFAULT   ""                   //!< a default Value for an STRING
    9581
  • trunk/src/lib/Makefile.am

    r5536 r5634  
    4040                        util/helper_functions.cc \
    4141                        util/multi_type.cc \
     42                        util/executor/executor.cc \
    4243                        math/vector.cc \
    4344                        math/curve.cc
     
    5758                        util/helper_functions.h \
    5859                        util/multi_type.h \
     60                        util/executor/executor.h \
    5961                        math/vector.h \
    6062                        math/curve.h
  • trunk/src/lib/Makefile.in

    r5536 r5634  
    5858        ini_parser.$(OBJEXT) substring.$(OBJEXT) color.$(OBJEXT) \
    5959        helper_functions.$(OBJEXT) multi_type.$(OBJEXT) \
    60         vector.$(OBJEXT) curve.$(OBJEXT)
     60        executor.$(OBJEXT) vector.$(OBJEXT) curve.$(OBJEXT)
    6161libORXlibs_a_OBJECTS = $(am_libORXlibs_a_OBJECTS)
    6262DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
     
    229229                        util/helper_functions.cc \
    230230                        util/multi_type.cc \
     231                        util/executor/executor.cc \
    231232                        math/vector.cc \
    232233                        math/curve.cc
     
    246247                        util/helper_functions.h \
    247248                        util/multi_type.h \
     249                        util/executor/executor.h \
    248250                        math/vector.h \
    249251                        math/curve.h
     
    311313@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/color.Po@am__quote@
    312314@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/curve.Po@am__quote@
     315@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/executor.Po@am__quote@
    313316@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/helper_functions.Po@am__quote@
    314317@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ini_parser.Po@am__quote@
     
    458461@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    459462@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o multi_type.obj `if test -f 'util/multi_type.cc'; then $(CYGPATH_W) 'util/multi_type.cc'; else $(CYGPATH_W) '$(srcdir)/util/multi_type.cc'; fi`
     463
     464executor.o: util/executor/executor.cc
     465@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT executor.o -MD -MP -MF "$(DEPDIR)/executor.Tpo" -c -o executor.o `test -f 'util/executor/executor.cc' || echo '$(srcdir)/'`util/executor/executor.cc; \
     466@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/executor.Tpo" "$(DEPDIR)/executor.Po"; else rm -f "$(DEPDIR)/executor.Tpo"; exit 1; fi
     467@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/executor/executor.cc' object='executor.o' libtool=no @AMDEPBACKSLASH@
     468@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     469@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o executor.o `test -f 'util/executor/executor.cc' || echo '$(srcdir)/'`util/executor/executor.cc
     470
     471executor.obj: util/executor/executor.cc
     472@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT executor.obj -MD -MP -MF "$(DEPDIR)/executor.Tpo" -c -o executor.obj `if test -f 'util/executor/executor.cc'; then $(CYGPATH_W) 'util/executor/executor.cc'; else $(CYGPATH_W) '$(srcdir)/util/executor/executor.cc'; fi`; \
     473@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/executor.Tpo" "$(DEPDIR)/executor.Po"; else rm -f "$(DEPDIR)/executor.Tpo"; exit 1; fi
     474@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/executor/executor.cc' object='executor.obj' libtool=no @AMDEPBACKSLASH@
     475@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     476@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o executor.obj `if test -f 'util/executor/executor.cc'; then $(CYGPATH_W) 'util/executor/executor.cc'; else $(CYGPATH_W) '$(srcdir)/util/executor/executor.cc'; fi`
    460477
    461478vector.o: math/vector.cc
     
    621638
    622639distdir: $(DISTFILES)
    623         $(mkdir_p) $(distdir)/coord $(distdir)/graphics/render2D $(distdir)/lang $(distdir)/math $(distdir)/util
     640        $(mkdir_p) $(distdir)/coord $(distdir)/graphics/render2D $(distdir)/lang $(distdir)/math $(distdir)/util $(distdir)/util/executor
    624641        @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
    625642        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
  • trunk/src/lib/shell/shell_command.cc

    r5555 r5634  
    584584    switch (this->parameters[i])
    585585    {
    586       case ParameterBool:
     586      case MT_BOOL:
    587587        this->defaultValue[i].setInt(va_arg(defaultList, int));
    588588        break;
    589       case ParameterChar:
     589      case MT_CHAR:
    590590        this->defaultValue[i].setChar((char)va_arg(defaultList, int));
    591591        break;
    592       case ParameterString:
     592      case MT_STRING:
    593593        this->defaultValue[i].setString(va_arg(defaultList, char*));
    594594        break;
    595       case ParameterInt:
     595      case MT_INT:
    596596        this->defaultValue[i].setInt(va_arg(defaultList, int));
    597597        break;
    598       case ParameterUInt:
     598/*      case MT_UINT:
    599599        this->defaultValue[i].setInt((int)va_arg(defaultList, unsigned int));
    600         break;
    601       case ParameterFloat:
     600        break;*/
     601      case MT_FLOAT:
    602602        this->defaultValue[i].setFloat(va_arg(defaultList, double));
    603603        break;
    604       case ParameterLong:
     604/*      case MT_LONG:
    605605        this->defaultValue[i].setInt((int) va_arg(defaultList, long));
    606         break;
     606        break;*/
    607607      default:
    608608        break;
     
    654654const char* ShellCommandBase::paramToString(long parameter)
    655655{
    656   switch (parameter)
     656  return MultiType::MultiTypeToString((MT_Type)parameter);
     657// FIXME
     658  /*  switch (parameter)
    657659  {
    658660    case ParameterBool:
     
    680682      return "NULL";
    681683      break;
    682   }
    683 }
     684  }*/
     685}
  • trunk/src/util/loading/load_param.cc

    r5549 r5634  
    8080        switch (tmpType)
    8181        {
    82           case ParameterInt:
     82          case MT_INT:
    8383            sprintf(defaultVal, "%d", va_arg(types, int));
    8484            break;
    85           case ParameterLong:
     85/*          case MT_LONG:
    8686            sprintf(defaultVal, "%0.3f", va_arg(types, l_LONG_TYPE));
    87             break;
    88           case ParameterFloat:
     87            break;*/
     88          case MT_FLOAT:
    8989            sprintf(defaultVal, "%0.3f", va_arg(types, double));
    9090            break;
    91           case ParameterString:
     91          case MT_STRING:
    9292            sprintf(defaultVal, "%s", va_arg(types, l_STRING_TYPE));
    9393            break;
    94           case ParameterXML:
     94          case MT_EXT1:
    9595            sprintf(defaultVal, "");
    9696            break;
  • trunk/src/util/loading/load_param_description.cc

    r5556 r5634  
    7171    if (i > 0)
    7272      PRINT(3)(",");
    73     switch (this->types[i])
    74     {
    75       default:
    76         PRINTF(3)("none");
    77         break;
    78       case ParameterBool:
    79         PRINT(3)("bool");
    80         break;
    81       case ParameterChar:
    82         PRINT(3)("char");
    83         break;
    84       case ParameterString:
    85         PRINT(3)("string");
    86         break;
    87       case ParameterInt:
    88         PRINT(3)("int");
    89         break;
    90       case ParameterUInt:
    91         PRINT(3)("Uint");
    92         break;
    93       case ParameterFloat:
    94         PRINT(3)("float");
    95         break;
    96       case ParameterLong:
    97         PRINT(3)("long");
    98         break;
    99       case ParameterXML:
    100         PRINT(3)("XML");
    101         break;
    102     }
     73    // FIXME
     74    //     switch (this->types[i])
     75//     {
     76//       default:
     77//         PRINTF(3)("none");
     78//         break;
     79//       case ParameterBool:
     80//         PRINT(3)("bool");
     81//         break;
     82//       case ParameterChar:
     83//         PRINT(3)("char");
     84//         break;
     85//       case ParameterString:
     86//         PRINT(3)("string");
     87//         break;
     88//       case ParameterInt:
     89//         PRINT(3)("int");
     90//         break;
     91//       case ParameterUInt:
     92//         PRINT(3)("Uint");
     93//         break;
     94//       case ParameterFloat:
     95//         PRINT(3)("float");
     96//         break;
     97//       case ParameterLong:
     98//         PRINT(3)("long");
     99//         break;
     100//       case ParameterXML:
     101//         PRINT(3)("XML");
     102//         break;
     103//     }
    103104  }
    104105  PRINT(3)("</%s>", this->paramName);
     
    113114      if (i > 0)
    114115        PRINT(3)(", ");
    115       if (this->types[i] & ParameterString)
     116      if (this->types[i] & MT_STRING)
    116117      { // leave brackets !!
    117118        PRINT(3)("\"%s\"", this->defaultValues[i]);
  • trunk/src/world_entities/player.cc

    r5556 r5634  
    3333#include "event.h"
    3434
     35#include "executor/executor.h"
    3536
    3637using namespace std;
     
    118119void Player::init()
    119120{
     121  Executor* test =  new ExecutorObjective<Player>("test", "Player", &Player::ADDWEAPON);
     122
    120123//  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
    121124  this->setClassID(CL_PLAYER, "Player");
     
    161164  this->weaponMan->setSlotPosition(9, Vector(-2.5, -0.3, 2.0));
    162165  this->weaponMan->setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));
    163 
    164166}
    165167
Note: See TracChangeset for help on using the changeset viewer.