Beispiel #1
0
hash<ObjectId>::result_type hash<ObjectId>::operator()(argument_type const& id) const {
	result_type result;
	switch (id.subtype) {
	default:
	case ObjectIdKind::Null:
		return 0;
	case ObjectIdKind::Prototype:
		return sIntHasher(id.GetPrototypeId());
	case ObjectIdKind::Permanent:
		result = sHandleHasher(*(uint64_t*)&id.body.guid.Data1);
		result ^= sHandleHasher(*(uint64_t*)&id.body.guid.Data4[0]);
		return result;
	case ObjectIdKind::Positional:
		result = sHandleHasher(*(uint64_t*)&id.body.pos.x);
		result ^= sHandleHasher(*(uint64_t*)&id.body.pos.tempId);
		return result;
	case ObjectIdKind::Handle:
		return sHandleHasher(id.GetHandle());
	case ObjectIdKind::Blocked:
		return 0;
	}
}