-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathBootstrap.cs
29 lines (25 loc) · 1.13 KB
/
Bootstrap.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
namespace Loaf
{
public static class Bootstrap
{
public static void Main()
{
// Configure Dec's error reporting
Dec.Config.InfoHandler = str => Dbg.Inf(str);
Dec.Config.WarningHandler = str => Dbg.Wrn(str);
Dec.Config.ErrorHandler = str => Dbg.Err(str);
Dec.Config.ExceptionHandler = e => Dbg.Ex(e);
// Configure Dec's namespaces
Dec.Config.UsingNamespaces = new string[] { "Loaf" };
// In most cases, you'll just want to read all the XML files in your data directory, which is easy
var parser = new Dec.Parser();
parser.AddDirectory("data");
parser.Finish();
// Everything is now initialized; start the game!
Game.Run();
// In most actual games you'd put this code behind a loading screen of some sort.
// At the moment, dec loading is essentially atomic and without a progress bar; also, nobody has ever written enough dec files to justify a progress bar.
// Please let the developers know if you need this functionality!
}
}
}