File: code.h

package info (click to toggle)
aime 0.60.3-7
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 6,016 kB
  • ctags: 5,217
  • sloc: cpp: 77,611; ansic: 3,765; sh: 2,996; makefile: 234; sed: 93
file content (71 lines) | stat: -rw-r--r-- 1,460 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef _CODE_H
#define _CODE_H

#include "specials.h"
#include "mudtypes.h"

#define FORMAT_FUNC 0
#define FORMAT_EQ   1

class params {
 public:
   params();
   ~params();
   int       param_type;
   var_ptrs  the_param;
};

struct in_params {
   MudObject *primary_obj;
   MudObject *secondary_obj;
   MudObject *this_obj;
};


class Code {
public:
   Code(char *the_funct);
   Code(Spec_Func the_funct);
   virtual ~Code();
   int    check_valid();

   int    add_param(params *the_param);
   int    add_pass_param(params *the_param);
   params *get_param(int the_num);
   
   params *execute_command(Specials *the_special, Individual *the_user, 
        in_params *player_params, int *the_results, special_env *environment);
   int    load_from_file(FILE *the_file, ErrLog *the_log);
   int    load_from_file(FILE *the_file, ErrLog *the_log, int the_format);

   Code      *get_next_code();
   int       set_next_code(Code *the_code);
   Code      **get_next_ptr();
   Spec_Func get_funct_ptr();
   int       copy_code(Code *copy_from);
   LinkedList<params> *copy_param_list_to(LinkedList<params> *the_list);
   void      set_var_name(char *new_name);
   char      *get_var_name();

   virtual int get_mem_size_dynamic();
   virtual int get_mem_size();

private:

   Code();

   Spec_Func the_mudcode;
   LinkedList<params> param_list;
   LinkedList<params> pass_list;
   int       valid;

   Strings   var_name;

   Code      *next_code;
};

#endif