-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCivilianWorld.cs
52 lines (47 loc) · 1.44 KB
/
CivilianWorld.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using Arcen.AIW2.Core;
using Arcen.Universal;
using SKCivilianIndustry.Persistence;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SKCivilianIndustry
{
/// <summary>
/// World storage class. Everything can be found from here.
/// </summary>
public class CivilianWorld
{
/// <summary>
/// Version of this class.
/// </summary>
public int Version;
/// <summary>
/// Indicates whether resources have been already generated.
/// </summary>
public bool GeneratedResources = false;
// Following two functions are used for saving, and loading data.
public CivilianWorld() { }
/// <summary>
/// Used to save data to buffer.
/// </summary>
public void SerializeTo(ArcenSerializationBuffer Buffer)
{
Buffer.AddInt32( ReadStyle.NonNeg, 1 );
Buffer.AddItem( GeneratedResources );
}
/// <summary>
/// Used to load our data.
/// </summary>
/// <remarks>
/// Make sure that loading order is the same as the saving order.
/// </remarks>
/// <param name="Buffer"></param>
public CivilianWorld(ArcenDeserializationBuffer Buffer)
{
Version = Buffer.ReadInt32(ReadStyle.NonNeg );
this.GeneratedResources = Buffer.ReadBool();
}
}
}