-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGenerateTestCode.cs
More file actions
40 lines (30 loc) · 2.26 KB
/
GenerateTestCode.cs
File metadata and controls
40 lines (30 loc) · 2.26 KB
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
namespace CommandForgeGenerator.Tests;
public class GenerateTestCode
{
public const string TextCommand = """
#if ENABLE_COMMAND_FORGE_GENERATOR
namespace CommandForgeGenerator.Command
{
public partial class TextCommand : ICommandForgeCommand
{
public const string Type = "text";
public readonly CommandId CommandId;
public readonly string Character;
public readonly string Body;
public static TextCommand Create(int commandId, global::Newtonsoft.Json.Linq.JToken json)
{
var Character = (string)json["character"];
var Body = (string)json["body"];
return new TextCommand(commandId, Character, Body);
}
public TextCommand(int commandId, string Character, string Body)
{
CommandId = (CommandId)commandId;
this.Character = Character;
this.Body = Body;
}
}
}
#endif
""";
}