mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 18:18:18 +00:00
20 lines
342 B
C
20 lines
342 B
C
|
|
||
|
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]); };
|
||
|
};
|
||
|
|