… | |
… | |
88 | |
88 | |
89 | struct UUID |
89 | struct UUID |
90 | { |
90 | { |
91 | uint64 seq; |
91 | uint64 seq; |
92 | |
92 | |
|
|
93 | static UUID cur; // last uuid generated |
|
|
94 | static void init (); |
|
|
95 | static UUID gen (); |
|
|
96 | |
93 | UUID () { } |
97 | UUID () { } |
94 | UUID (uint64 seq) : seq(seq) { } |
98 | UUID (uint64 seq) : seq(seq) { } |
95 | operator uint64() { return seq; } |
99 | operator uint64() { return seq; } |
96 | void operator =(uint64 seq) { this->seq = seq; } |
100 | void operator =(uint64 seq) { this->seq = seq; } |
97 | }; |
|
|
98 | |
101 | |
99 | extern void init_uuid (); |
102 | typedef char BUF [32]; |
100 | extern UUID gen_uuid (); |
103 | |
101 | extern const uint64 UUID_SKIP; |
104 | bool parse (const char *s) |
|
|
105 | { |
|
|
106 | return sscanf (s, "<1.%" SCNx64 ">", &seq) == 1; |
|
|
107 | } |
|
|
108 | |
|
|
109 | const char *c_str (char *buf, int len) const |
|
|
110 | { |
|
|
111 | snprintf (buf, len, "<1.%" PRIx64 ">", seq); |
|
|
112 | |
|
|
113 | return buf; |
|
|
114 | } |
|
|
115 | |
|
|
116 | const char *c_str () const |
|
|
117 | { |
|
|
118 | static BUF buf; |
|
|
119 | |
|
|
120 | return c_str (buf, sizeof (buf)); |
|
|
121 | } |
|
|
122 | }; |
102 | |
123 | |
103 | /* Definition for WILL_APPLY values. Replaces having harcoded values |
124 | /* Definition for WILL_APPLY values. Replaces having harcoded values |
104 | * sprinkled in the code. Note that some of these also replace fields |
125 | * sprinkled in the code. Note that some of these also replace fields |
105 | * that were in the can_apply area. What is the point of having both |
126 | * that were in the can_apply area. What is the point of having both |
106 | * can_apply and will_apply? |
127 | * can_apply and will_apply? |
… | |
… | |
448 | MTH void activate (); |
469 | MTH void activate (); |
449 | MTH void deactivate (); |
470 | MTH void deactivate (); |
450 | MTH void activate_recursive (); |
471 | MTH void activate_recursive (); |
451 | MTH void deactivate_recursive (); |
472 | MTH void deactivate_recursive (); |
452 | |
473 | |
453 | // set the givne flag on all objects in the inventory recursively |
474 | // set the given flag on all objects in the inventory recursively |
454 | MTH void set_flag_inv (int flag, int value = 1); |
475 | MTH void set_flag_inv (int flag, int value = 1); |
455 | |
476 | |
456 | void enter_exit (object *exit);//Perl |
477 | void enter_exit (object *exit);//Perl |
457 | MTH void enter_map (maptile *newmap, int x, int y); |
478 | MTH void enter_map (maptile *newmap, int x, int y); |
458 | |
479 | |
… | |
… | |
551 | } objectlink; |
572 | } objectlink; |
552 | |
573 | |
553 | typedef struct oblinkpt |
574 | typedef struct oblinkpt |
554 | { /* Used to link together several object links */ |
575 | { /* Used to link together several object links */ |
555 | struct oblnk *link; |
576 | struct oblnk *link; |
556 | long value; /* Used as connected value in buttons/gates */ |
577 | sint32 value; /* Used as connected value in buttons/gates */ |
557 | struct oblinkpt *next; |
578 | struct oblinkpt *next; |
558 | } oblinkpt; |
579 | } oblinkpt; |
559 | |
580 | |
560 | object *find_skill_by_name (object *who, const char *name); |
581 | object *find_skill_by_name (object *who, const char *name); |
561 | object *find_skill_by_name (object *who, const shstr &sh); |
582 | object *find_skill_by_name (object *who, const shstr &sh); |