-
Notifications
You must be signed in to change notification settings - Fork 3
/
Config.cs
33 lines (27 loc) · 942 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
using System.Collections.Generic;
namespace Loaf
{
// In many situations I've found it useful to have a ConfigDec class with a bunch of global parameters.
// This is simply making use of the Dec system to provide a centralized settings registry.
// It's overkill, but it's effective.
public class ConfigDec : Dec.Dec
{
public int baud;
public float crlfDelay;
public bool suppressDelay = false;
public int playerHp;
public List<ItemDec> startingItems;
public string saveFilename;
public bool alternateEnding = false;
}
// Using a StaticReferences for the global ConfigDec means you can access it from anywhere via Config.Global.fieldName.
[Dec.StaticReferences]
public static class Config
{
static Config()
{
Dec.StaticReferencesAttribute.Initialized();
}
public static ConfigDec Global;
}
}