-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEditor.cs
42 lines (33 loc) · 900 Bytes
/
Editor.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
using System.Collections.Generic;
namespace TextEditor
{
public class Editor
{
List<Buffer> Buffers;
List<Window> Windows;
public Editor()
{
Buffers = new List<Buffer>();
Windows = new List<Window>();
Buffers.Add(new Buffer());
int h = Console.WindowHeight;
int w = Console.WindowWidth;
Window InitialWindow = new Window(h, w);
Windows.Add(InitialWindow);
// Console.SetBufferSize(w, h); // can't do on Linux (Ubuntu 22.10 + bash)
}
public Buffer GetActiveBuffer()
{
return Buffers.First();
}
public Window GetActiveWindow()
{
return Windows.First();
}
public void Run()
{
UI ui = new UI(GetActiveWindow());
ui.Run();
}
}
}