Another restructure with code updates.
Updated RectTextrue.cs, VertexInformation.cs, and IDrawable.cs to properly pass indice information.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace RecrownedGTK.Tools.CommandProcessor.Commands
|
||||
{
|
||||
internal class ClearConsoleCommand : EngineCommand
|
||||
{
|
||||
public ClearConsoleCommand() : base("clear")
|
||||
{
|
||||
help = "Clears the console.";
|
||||
}
|
||||
|
||||
public override void Run(string[] arguments = null)
|
||||
{
|
||||
Console.Clear();
|
||||
}
|
||||
}
|
||||
}
|
53
RecrownedGTK.Tools/CommandProcessor/Commands/HelpCommand.cs
Normal file
53
RecrownedGTK.Tools/CommandProcessor/Commands/HelpCommand.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
|
||||
namespace RecrownedGTK.Tools.CommandProcessor.Commands
|
||||
{
|
||||
internal class HelpCommand : EngineCommand
|
||||
{
|
||||
CommandEngine commandEngine;
|
||||
|
||||
public HelpCommand(CommandEngine commandEngine) : base("help")
|
||||
{
|
||||
this.commandEngine = commandEngine;
|
||||
help = "help [command] [arg]";
|
||||
}
|
||||
|
||||
|
||||
public override void Run(string[] arguments)
|
||||
{
|
||||
if (arguments != null)
|
||||
{
|
||||
if (commandEngine.ContainsCommand(arguments[0]))
|
||||
{
|
||||
if (arguments.Length < 2) ConsoleUtilities.WriteWrappedLine(commandEngine.GetCommand(arguments[0]).Help(null));
|
||||
for (int i = 1; i < arguments.Length; i++)
|
||||
{
|
||||
ConsoleUtilities.WriteWrappedLine(commandEngine.GetCommand(arguments[0]).Help(arguments[i]));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException(arguments[0] + " not a command. Type \"help\" for a list of commands.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ConsoleUtilities.WriteWrappedLine("Tools for RecrownedGTK library. Possible commands are as follows:\n");
|
||||
foreach (EngineCommand engineCommand in commandEngine.commands)
|
||||
{
|
||||
for (int i = 0; i < engineCommand.InvokeStrings.Length; i++)
|
||||
{
|
||||
ConsoleUtilities.WriteWrapped(engineCommand.InvokeStrings[i]);
|
||||
if (i + 1 < engineCommand.InvokeStrings.Length)
|
||||
{
|
||||
ConsoleUtilities.WriteWrapped(", ");
|
||||
}
|
||||
}
|
||||
ConsoleUtilities.WriteWrapped(" : ");
|
||||
ConsoleUtilities.WriteWrapped(engineCommand.Help().Replace("\n", "\n\t"), true);
|
||||
Console.WriteLine("--------");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
18
RecrownedGTK.Tools/CommandProcessor/Commands/StopCommand.cs
Normal file
18
RecrownedGTK.Tools/CommandProcessor/Commands/StopCommand.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace RecrownedGTK.Tools.CommandProcessor.Commands
|
||||
{
|
||||
internal class StopCommand : EngineCommand
|
||||
{
|
||||
CommandEngine commandEngine;
|
||||
|
||||
public StopCommand(CommandEngine commandEngine) : base("quit", "stop", "q", "exit")
|
||||
{
|
||||
this.commandEngine = commandEngine;
|
||||
help = "Exits the tool.";
|
||||
}
|
||||
|
||||
public override void Run(string[] arguments = null)
|
||||
{
|
||||
commandEngine.running = false;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user