~ubuntu-branches/debian/squeeze/openttd/squeeze

« back to all changes in this revision

Viewing changes to src/saveload/group_sl.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach, Matthijs Kooijman, Jordi Mallach
  • Date: 2009-04-15 18:22:10 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090415182210-22ktb8kdbp2tf3bm
[ Matthijs Kooijman ]
* New upstream release.
* Remove Debian specific desktop file, upstream provides one now. 
* Add debian/watch file.

[ Jordi Mallach ]
* Bump Standards-Version to 3.8.1, with no changes required.
* Move to debhelper compat 7. Bump Build-Depends accordingly.
* Use dh_prep.
* Add "set -e" to config script.
* Remove a few extra doc files that get installed by upstream Makefile.
* Add more complete copyright information.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: group_sl.cpp 15903 2009-03-30 23:15:05Z rubidium $ */
 
2
 
 
3
/** @file group_sl.cpp Code handling saving and loading of economy data */
 
4
 
 
5
#include "../stdafx.h"
 
6
#include "../group.h"
 
7
 
 
8
#include "saveload.h"
 
9
 
 
10
static const SaveLoad _group_desc[] = {
 
11
  SLE_CONDVAR(Group, name,           SLE_NAME,    0, 83),
 
12
  SLE_CONDSTR(Group, name,           SLE_STR, 0, 84, SL_MAX_VERSION),
 
13
  SLE_VAR(Group, num_vehicle,        SLE_UINT16),
 
14
  SLE_VAR(Group, owner,              SLE_UINT8),
 
15
  SLE_VAR(Group, vehicle_type,       SLE_UINT8),
 
16
  SLE_VAR(Group, replace_protection, SLE_BOOL),
 
17
  SLE_END()
 
18
};
 
19
 
 
20
static void Save_GRPS(void)
 
21
{
 
22
        Group *g;
 
23
 
 
24
        FOR_ALL_GROUPS(g) {
 
25
                SlSetArrayIndex(g->index);
 
26
                SlObject(g, _group_desc);
 
27
        }
 
28
}
 
29
 
 
30
 
 
31
static void Load_GRPS(void)
 
32
{
 
33
        int index;
 
34
 
 
35
        while ((index = SlIterateArray()) != -1) {
 
36
                Group *g = new (index) Group();
 
37
                SlObject(g, _group_desc);
 
38
        }
 
39
}
 
40
 
 
41
extern const ChunkHandler _group_chunk_handlers[] = {
 
42
        { 'GRPS', Save_GRPS, Load_GRPS, CH_ARRAY | CH_LAST},
 
43
};