ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/object.h
(Generate patch)

Comparing deliantra/server/include/object.h (file contents):
Revision 1.51 by root, Wed Dec 13 03:28:42 2006 UTC vs.
Revision 1.55 by root, Fri Dec 15 20:08:45 2006 UTC

16 16
17 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software 18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 20
21 The authors can be reached via e-mail at crossfire-devel@real-time.com 21 The authors can be reached via e-mail at crossfire@schmorp.de
22*/ 22*/
23 23
24#ifndef OBJECT_H 24#ifndef OBJECT_H
25#define OBJECT_H 25#define OBJECT_H
26 26
59}; 59};
60 60
61struct UUID 61struct UUID
62{ 62{
63 uint64 seq; 63 uint64 seq;
64
65 UUID () { }
66 UUID (uint64 seq) : seq(seq) { }
67 operator uint64() { return seq; }
68 void operator =(uint64 seq) { this->seq = seq; }
64}; 69};
65 70
66extern void init_uuid (); 71extern void init_uuid ();
67extern UUID gen_uuid (); 72extern UUID gen_uuid ();
68extern const uint64 UUID_SKIP; 73extern const uint64 UUID_SKIP;
255 static bool can_merge_slow (object *op1, object *op2); 260 static bool can_merge_slow (object *op1, object *op2);
256 261
257 // this is often used in time-critical code, so optimise 262 // this is often used in time-critical code, so optimise
258 static bool can_merge (object *op1, object *op2) 263 static bool can_merge (object *op1, object *op2)
259 { 264 {
260 return op1->value != op2->value 265 return op1->value == op2->value
261 && op1->name != op2->name 266 && op1->name == op2->name
262 && can_merge_slow (op1, op2); 267 && can_merge_slow (op1, op2);
263 } 268 }
264 269
265 void clear (); 270 void clear ();
266 271

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines