-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfig.cs
40 lines (32 loc) · 893 Bytes
/
Config.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
using System;
namespace Halite
{
public class Config
{
public int PlayerTag { get; private set; }
public int MapWidth { get; private set; }
public int MapHeight { get; private set; }
public int Turn { get; private set; }
private static Config _config;
public static void Init(int playerTag, int mapWidth, int mapHeight)
{
_config = new Config
{
PlayerTag = playerTag,
MapHeight = mapHeight,
MapWidth = mapWidth,
Turn = 0
};
}
public static Config Get()
{
if (_config == null)
throw new Exception("Config not initialised");
return _config;
}
public static void IncrementTurn()
{
Get().Turn++;
}
}
}