@@ -17,7 +17,7 @@ public void Run(MessageInfoList messageInfoList, string outputPath, string names
1717 sb . Append ( "import IHeartBeatMessage from \" ../network/IHeartBeatMessage\" ;\n " ) ;
1818 sb . Append ( "import MessageObject from \" ../network/MessageObject\" ;\n " ) ;
1919 sb . Append ( "import ProtoMessageHelper from \" ../network/ProtoMessageHelper\" ;\n " ) ;
20- sb . AppendLine ( ) ;
20+ sb . Append ( " \n " ) ;
2121 sb . Append ( $ "export namespace { messageInfoList . ModuleName } { '{' } \n ") ;
2222
2323 foreach ( var operationCodeInfo in messageInfoList . Infos )
@@ -27,8 +27,8 @@ public void Run(MessageInfoList messageInfoList, string outputPath, string names
2727 sb . Append ( $ "\t /// <summary>\n ") ;
2828 sb . Append ( $ "\t /// { operationCodeInfo . Description } \n ") ;
2929 sb . Append ( $ "\t /// </summary>\n ") ;
30- sb . AppendLine ( $ "\t export enum { operationCodeInfo . Name } ") ;
31- sb . AppendLine ( "\t {" ) ;
30+ sb . Append ( $ "\t export enum { operationCodeInfo . Name } \n ") ;
31+ sb . Append ( "\t {\n " ) ;
3232 foreach ( var operationField in operationCodeInfo . Fields )
3333 {
3434 sb . Append ( $ "\t \t /// <summary>\n ") ;
@@ -37,7 +37,7 @@ public void Run(MessageInfoList messageInfoList, string outputPath, string names
3737 sb . Append ( $ "\t \t { operationField . Type } = { operationField . Members } , \n ") ;
3838 }
3939
40- sb . AppendLine ( "\t }\n " ) ;
40+ sb . Append ( "\t }\n \n " ) ;
4141 }
4242 else
4343 {
@@ -55,13 +55,13 @@ public void Run(MessageInfoList messageInfoList, string outputPath, string names
5555
5656 if ( string . IsNullOrEmpty ( operationCodeInfo . ParentClass ) )
5757 {
58- sb . AppendLine ( $ "\t export class { operationCodeInfo . Name } { '{' } ") ;
58+ sb . Append ( $ "\t export class { operationCodeInfo . Name } { '{' } \n ") ;
5959 }
6060 else
6161 {
6262 // sb.AppendLine($"\t[MessageTypeHandler({operationCodeInfo.Opcode})]");
63- sb . AppendLine ( $ "\t export class { operationCodeInfo . Name } extends MessageObject implements { operationCodeInfo . ParentClass } { '{' } ") ;
64- sb . AppendLine ( ) ;
63+ sb . Append ( $ "\t export class { operationCodeInfo . Name } extends MessageObject implements { operationCodeInfo . ParentClass } { '{' } \n ") ;
64+ sb . Append ( " \n " ) ;
6565
6666 sb . Append ( $ "\t \t public static register(): void{ '{' } \n ") ;
6767 if ( operationCodeInfo . IsRequest )
@@ -74,13 +74,13 @@ public void Run(MessageInfoList messageInfoList, string outputPath, string names
7474 }
7575
7676 sb . Append ( $ "\t \t { '}' } \n ") ;
77-
78-
77+
78+
7979 sb . Append ( $ "\t \t public get PackageName(): string{ '{' } \n ") ;
8080 sb . Append ( $ "\t \t \t return '{ messageInfoList . ModuleName } .{ operationCodeInfo . Name } ';\n ") ;
8181 sb . Append ( $ "\t \t { '}' } \n ") ;
8282
83- sb . AppendLine ( ) ;
83+ sb . Append ( " \n " ) ;
8484 }
8585
8686 foreach ( var operationField in operationCodeInfo . Fields )
@@ -107,7 +107,7 @@ public void Run(MessageInfoList messageInfoList, string outputPath, string names
107107 }
108108
109109
110- sb . AppendLine ( "\t }\n " ) ;
110+ sb . Append ( "\t }\n \n " ) ;
111111 }
112112 }
113113
@@ -190,12 +190,12 @@ public void Post(List<MessageInfoList> operationCodeInfo, string launcherOptions
190190 {
191191 if ( ! string . IsNullOrEmpty ( messageInfo . ParentClass ) )
192192 {
193- stringBuilder . AppendLine ( $ "\t \t { messageInfoList . ModuleName } .{ messageInfo . Name } .register();") ;
193+ stringBuilder . Append ( $ "\t \t { messageInfoList . ModuleName } .{ messageInfo . Name } .register();\n ") ;
194194 }
195195 }
196196 }
197197
198- stringBuilder . AppendLine ( " }\n }" ) ;
198+ stringBuilder . Append ( " }\n }\n " ) ;
199199 File . WriteAllText ( launcherOptionsOutputPath + "/ProtoMessageRegister.ts" , stringBuilder . ToString ( ) , Encoding . UTF8 ) ;
200200 }
201201 }
0 commit comments