the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include "Settings.h"
3#include "..\Minecraft.World\StringHelpers.h"
4
5// 4J - TODO - serialise/deserialise from file
6Settings::Settings(File *file)
7{
8}
9
10void Settings::generateNewProperties()
11{
12}
13
14void Settings::saveProperties()
15{
16}
17
18wstring Settings::getString(const wstring& key, const wstring& defaultValue)
19{
20 if(properties.find(key) == properties.end())
21 {
22 properties[key] = defaultValue;
23 saveProperties();
24 }
25 return properties[key];
26}
27
28int Settings::getInt(const wstring& key, int defaultValue)
29{
30 if(properties.find(key) == properties.end())
31 {
32 properties[key] = _toString<int>(defaultValue);
33 saveProperties();
34 }
35 return _fromString<int>(properties[key]);
36}
37
38bool Settings::getBoolean(const wstring& key, bool defaultValue)
39{
40 if(properties.find(key) == properties.end())
41 {
42 properties[key] = _toString<bool>(defaultValue);
43 saveProperties();
44 }
45 MemSect(35);
46 bool retval = _fromString<bool>(properties[key]);
47 MemSect(0);
48 return retval;
49}
50
51void Settings::setBooleanAndSave(const wstring& key, bool value)
52{
53 properties[key] = _toString<bool>(value);
54 saveProperties();
55}