mirror of
https://github.com/Stone-Red-Code/Commander.NET.git
synced 2026-09-04 00:46:08 +02:00
Initial commit
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Commander.NET\Commander.NET.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,33 @@
|
||||
using Commander_Net;
|
||||
|
||||
Console.WriteLine("Hello, World!");
|
||||
|
||||
Commander commander = new Commander();
|
||||
Command sayCommand = commander.Register(HahaYes, "say", "tell");
|
||||
sayCommand.Register(HahaYesSub, "kek");
|
||||
|
||||
commander.Register(HahaNo, "scream", "yell");
|
||||
commander.Register((args) => Console.Clear(), "clear");
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (!commander.Execute(Console.ReadLine()!))
|
||||
{
|
||||
Console.WriteLine("Command not found!");
|
||||
}
|
||||
}
|
||||
|
||||
void HahaYes(string yes)
|
||||
{
|
||||
Console.WriteLine($">>> {yes}");
|
||||
}
|
||||
|
||||
void HahaYesSub(string yes)
|
||||
{
|
||||
Console.WriteLine($">>> {yes} xD");
|
||||
}
|
||||
|
||||
void HahaNo(string no)
|
||||
{
|
||||
Console.WriteLine($">>> {no.ToUpper()}");
|
||||
}
|
||||
Reference in New Issue
Block a user