mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
29 lines
952 B
C#
29 lines
952 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using CommandLine;
|
|
|
|
namespace ET.Server
|
|
{
|
|
[ConsoleHandler(ConsoleMode.CreateRobot)]
|
|
public class CreateRobotConsoleHandler: IConsoleHandler
|
|
{
|
|
public async ETTask Run(Fiber fiber, ModeContex contex, string content)
|
|
{
|
|
switch (content)
|
|
{
|
|
case ConsoleMode.CreateRobot:
|
|
Log.Console("CreateRobot args error!");
|
|
break;
|
|
default:
|
|
CreateRobotArgs options = null;
|
|
Parser.Default.ParseArguments<CreateRobotArgs>(content.Split(' '))
|
|
.WithNotParsed(error => throw new Exception($"CreateRobotArgs error!"))
|
|
.WithParsed(o => { options = o; });
|
|
|
|
break;
|
|
}
|
|
contex.Parent.RemoveComponent<ModeContex>();
|
|
await ETTask.CompletedTask;
|
|
}
|
|
}
|
|
} |