-
Notifications
You must be signed in to change notification settings - Fork 1
/
Program.cs
48 lines (41 loc) · 1.2 KB
/
Program.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
41
42
43
44
45
46
47
48
using Microsoft.Xna.Framework;
using SadConsole;
using Game = SadConsole.Game;
using Keys = Microsoft.Xna.Framework.Input.Keys;
namespace LedTableSimulator
{
public class Program
{
public static void Main()
{
Game.Create(20, 10);
Game.OnInitialize = Init;
Game.OnUpdate = Update;
Game.Instance.Run();
Game.Instance.Dispose();
}
private static void Init()
{
var mqtt = new Mqtt();
var tableConsole = new TableConsole(20, 10);
var ipConfigConsole = new IpConfigurationConsole(mqtt, 20, 3);
mqtt.OnFrameBufferReceived += (sender, bytes) =>
{
tableConsole.Draw(bytes);
};
ipConfigConsole.Connected += (sender, args) =>
{
Global.CurrentScreen = tableConsole;
};
Settings.ResizeWindow(800,800);
Global.CurrentScreen = ipConfigConsole;
}
private static void Update(GameTime obj)
{
if (Global.KeyboardState.IsKeyReleased(Keys.Escape))
{
Game.Instance.Exit();
}
}
}
}