Files
@ r12373:30da669f3dfa
Branch filter:
Location: cpp/openttd-patchpack/source/src/saveload/group_sl.cpp - annotation
r12373:30da669f3dfa
928 B
text/x-c
(svn r16813) -Codechange: make IsEngineCountable() member of Vehicle
r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r11962:0e3a6981e508 r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r11962:0e3a6981e508 r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r10571:99cb9a95b4cf r11930:314dbf13f3bf r10571:99cb9a95b4cf | /* $Id$ */
/** @file group_sl.cpp Code handling saving and loading of economy data */
#include "../stdafx.h"
#include "../group.h"
#include "saveload.h"
static const SaveLoad _group_desc[] = {
SLE_CONDVAR(Group, name, SLE_NAME, 0, 83),
SLE_CONDSTR(Group, name, SLE_STR, 0, 84, SL_MAX_VERSION),
SLE_VAR(Group, num_vehicle, SLE_UINT16),
SLE_VAR(Group, owner, SLE_UINT8),
SLE_VAR(Group, vehicle_type, SLE_UINT8),
SLE_VAR(Group, replace_protection, SLE_BOOL),
SLE_END()
};
static void Save_GRPS()
{
Group *g;
FOR_ALL_GROUPS(g) {
SlSetArrayIndex(g->index);
SlObject(g, _group_desc);
}
}
static void Load_GRPS()
{
int index;
while ((index = SlIterateArray()) != -1) {
Group *g = new (index) Group();
SlObject(g, _group_desc);
}
}
extern const ChunkHandler _group_chunk_handlers[] = {
{ 'GRPS', Save_GRPS, Load_GRPS, NULL, CH_ARRAY | CH_LAST},
};
|