about summary refs log tree commit diff
path: root/src/engine/snapshot.h
blob: 9d8034861565337f0b3edb12c205df0e80d54b19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

struct snapshot
{
	int num_items;
	int offsets[1];

	struct item
	{
		int type_and_id;
		char data[1];
		
		int type() { return type_and_id>>16; }
		int id() { return type_and_id&(0xffff); }
	};
	
	char *data_start() { return (char *)&offsets[num_items]; }
	item *get_item(int index) { return (item *)(data_start() + offsets[index]); };
};