Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #include "../stdafx.h"
00013 #include "../goal_base.h"
00014
00015 #include "saveload.h"
00016
00017 static const SaveLoad _goals_desc[] = {
00018 SLE_VAR(Goal, company, SLE_UINT16),
00019 SLE_VAR(Goal, type, SLE_UINT16),
00020 SLE_VAR(Goal, dst, SLE_UINT32),
00021 SLE_STR(Goal, text, SLE_STR | SLF_ALLOW_CONTROL, 0),
00022 SLE_END()
00023 };
00024
00025 static void Save_GOAL()
00026 {
00027 Goal *s;
00028 FOR_ALL_GOALS(s) {
00029 SlSetArrayIndex(s->index);
00030 SlObject(s, _goals_desc);
00031 }
00032 }
00033
00034 static void Load_GOAL()
00035 {
00036 int index;
00037 while ((index = SlIterateArray()) != -1) {
00038 Goal *s = new (index) Goal();
00039 SlObject(s, _goals_desc);
00040 }
00041 }
00042
00043 extern const ChunkHandler _goal_chunk_handlers[] = {
00044 { 'GOAL', Save_GOAL, Load_GOAL, NULL, NULL, CH_ARRAY | CH_LAST},
00045 };