Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8811 in orxonox.OLD


Ignore:
Timestamp:
Jun 26, 2006, 5:46:42 PM (18 years ago)
Author:
snellen
Message:

executor should now be able to take up to 7 parameters

Location:
branches/single_player_map/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/single_player_map/src/lib/util/executor/executor.cc

    r7742 r8811  
    3131                   const MultiType& param2,
    3232                   const MultiType& param3,
    33                    const MultiType& param4)
     33                   const MultiType& param4,
     34                   const MultiType& param5,
     35                   const MultiType& param6)
    3436{
    3537  this->setClassID(CL_EXECUTOR, "Executor");
     
    4143  this->defaultValue[3] = param3;
    4244  this->defaultValue[4] = param4;
     45  this->defaultValue[5] = param5;
     46  this->defaultValue[6] = param6;
    4347
    4448  this->paramCount = 0;
     
    8387                                  const MultiType& value2,
    8488                                  const MultiType& value3,
    85                                   const MultiType& value4)
     89                                  const MultiType& value4,
     90                                  const MultiType& value5,
     91                                  const MultiType& value6)
    8692{
    8793  if (this == NULL)
     
    94100  value[3] = &value3;
    95101  value[4] = &value4;
    96 
     102  value[5] = &value5;
     103  value[6] = &value6;
    97104  for (unsigned int i = 0; i < this->paramCount; i++)
    98105  {
  • branches/single_player_map/src/lib/util/executor/executor.h

    r8408 r8811  
    4747    Executor* defaultValues(const MultiType& value0 = MT_NULL, const MultiType& value1 = MT_NULL,
    4848                            const MultiType& value2 = MT_NULL, const MultiType& value3 = MT_NULL,
    49                             const MultiType& value4 = MT_NULL);
     49                            const MultiType& value4 = MT_NULL, const MultiType& param5 = MT_NULL,
     50                            const MultiType& param6 = MT_NULL);
    5051    /** @param i the i'th defaultValue, @returns reference to the MultiType */
    5152    inline MultiType& getDefaultValue(unsigned int i) { return defaultValue[i]; };
     
    6869    Executor(const MultiType& param0 = MT_NULL, const MultiType& param1 = MT_NULL,
    6970             const MultiType& param2 = MT_NULL, const MultiType& param3 = MT_NULL,
    70              const MultiType& param4 = MT_NULL);
     71             const MultiType& param4 = MT_NULL, const MultiType& param5 = MT_NULL,
     72             const MultiType& param6 = MT_NULL);
    7173
    7274    void cloning(Executor* executor) const;
     
    7577    short                       functorType;      //!< The type of Function we've got (either static or objective).
    7678    unsigned int                paramCount;       //!< the count of parameters.
    77     MultiType                   defaultValue[5];  //!< Default Values.
     79    MultiType                   defaultValue[7];  //!< Default Values.
    7880};
    7981
  • branches/single_player_map/src/lib/util/executor/functor_list.h

    r8619 r8811  
    2929
    3030//! defines the maximum count of arguments function pointers might have
    31 #define FUNCTOR_MAX_ARGUMENTS                5
     31#define FUNCTOR_MAX_ARGUMENTS                7
    3232#include "multi_type.h"
    3333
  • branches/single_player_map/src/world_entities/npcs/generic_npc.cc

    r8810 r8811  
    3838CREATE_FACTORY(GenericNPC, CL_GENERIC_NPC);
    3939
     40#include "script_class.h"
     41CREATE_SCRIPTABLE_CLASS(GenericNPC, CL_GENERIC_NPC,
     42                        addMethod("walkTo", ExecutorLua7ret<GenericNPC,float, float, float, float, float, float, float, float>(&GenericNPC::walkTo))
     43                       );
     44
    4045
    4146
     
    5257}
    5358
     59
     60GenericNPC::GenericNPC()
     61  : NPC(NULL)
     62{
     63 
     64}
    5465
    5566/**
  • branches/single_player_map/src/world_entities/npcs/generic_npc.h

    r8810 r8811  
    2828{
    2929 public:
     30  GenericNPC();
    3031  GenericNPC(const TiXmlElement* root);
    3132  virtual ~GenericNPC ();
  • branches/single_player_map/src/world_entities/npcs/npc.cc

    r8724 r8811  
    5050void NPC::loadParams(const TiXmlElement* root)
    5151{
    52   WorldEntity::loadParams(root);
     52  if(root != NULL)
     53   WorldEntity::loadParams(root);
    5354}
    5455
Note: See TracChangeset for help on using the changeset viewer.