Entitas  0.35.0
Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
EntitasPreferencesConfig.cs
1 namespace Entitas.Serialization.Configuration {
2 
3  public class EntitasPreferencesConfig {
4 
5  readonly Properties _properties;
6 
7  public EntitasPreferencesConfig(string config) {
8  _properties = new Properties(config);
9  }
10 
11  public string GetValueOrDefault(string key, string defaultValue) {
12  key = key.Trim();
13  if(!_properties.HasKey(key)) {
14  _properties[key] = defaultValue;
15  }
16 
17  return _properties[key];
18  }
19 
20  public string this[string key] {
21  get { return _properties[key]; }
22  set { _properties[key] = value; }
23  }
24 
25  public override string ToString() {
26  return _properties.ToString();
27  }
28  }
29 }