From 645d1083fecf707a56b07c1fd52df4015885d9ce Mon Sep 17 00:00:00 2001 From: Sophia Pearson Date: Sun, 4 Sep 2022 13:29:53 +0200 Subject: game: add StatusLine behavior --- Scripts/Game.cs | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 Scripts/Game.cs (limited to 'Scripts/Game.cs') diff --git a/Scripts/Game.cs b/Scripts/Game.cs deleted file mode 100644 index 07dab9a..0000000 --- a/Scripts/Game.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Diagnostics; -using Godot; - -namespace Texty.Scripts -{ - public abstract class Game : MarginContainer - { - public CommandParser CommandParser; - public VBoxContainer LayoutContainer; - public OutputContainer OutputContainer; - - [Export(PropertyHint.File, "*.tscn")] public PackedScene OutputRowScene; - - public override void _Ready() - { - Debug.Assert(OutputRowScene != null, $"The {nameof(OutputRowScene)} was not set!"); - - CommandParser = GetNode(nameof(CommandParser)); - LayoutContainer = GetNode(nameof(LayoutContainer)); - OutputContainer = LayoutContainer.GetNode(nameof(OutputContainer)); - } - - public void OnInputSubmitted(string text) - { - var newRow = OutputRowScene.Instance(); - newRow.InputText = text; - - var command = CommandParser.TryParse(text); - newRow.OutputText = command == null ? "Please rephrase your command" : "THE OUTPUT SHOULD GO HERE!"; - - OutputContainer.Add(newRow); - } - } -} \ No newline at end of file -- cgit v1.2.3