ref[csharp]: refactor generate csharp protocol

This commit is contained in:
godotg committed 2024-05-22 16:04:12 +08:00
1 parent 7fedbe547e
commit ab3ca0e17a
4 files changed
+8 -8

No files matched your search

@@ -27,7 +27,7 @@ public class NetConfig {
/** /**
* {@link GenerateOperation} * {@link GenerateOperation}
*/ */
private boolean mergerProtocol; private boolean mergeProtocol;
/** /**
* {@link GenerateOperation} * {@link GenerateOperation}
*/ */
@@ -81,12 +81,12 @@ public class NetConfig {
this.protocolLocation = protocolLocation; this.protocolLocation = protocolLocation;
} }
public boolean isMergerProtocol() { public boolean isMergeProtocol() {
return mergerProtocol; return mergeProtocol;
} }
public void setMergerProtocol(boolean mergerProtocol) { public void setMergeProtocol(boolean mergeProtocol) {
this.mergerProtocol = mergerProtocol; this.mergeProtocol = mergeProtocol;
} }
public boolean isFoldProtocol() { public boolean isFoldProtocol() {
@@ -92,7 +92,7 @@ public class PacketService implements IPacketService {
var protocolLocation = netConfig.getProtocolLocation(); var protocolLocation = netConfig.getProtocolLocation();
var generateOperation = new GenerateOperation(); var generateOperation = new GenerateOperation();
generateOperation.setMergeProtocol(netConfig.isMergerProtocol()); generateOperation.setMergeProtocol(netConfig.isMergeProtocol());
generateOperation.setFoldProtocol(netConfig.isFoldProtocol()); generateOperation.setFoldProtocol(netConfig.isFoldProtocol());
generateOperation.setProtocolPath(netConfig.getProtocolPath()); generateOperation.setProtocolPath(netConfig.getProtocolPath());
generateOperation.setProtocolParam(netConfig.getProtocolParam()); generateOperation.setProtocolParam(netConfig.getProtocolParam());
@@ -102,7 +102,7 @@ public class NetDefinitionParser implements BeanDefinitionParser {
resolvePlaceholder("protocol-location", "protocolLocation", builder, element, parserContext); resolvePlaceholder("protocol-location", "protocolLocation", builder, element, parserContext);
// 协议文件是否生成在同一个协议文件中 // 协议文件是否生成在同一个协议文件中
resolvePlaceholder("merger-protocol", "mergerProtocol", builder, element, parserContext); resolvePlaceholder("merge-protocol", "mergeProtocol", builder, element, parserContext);
// 文件是否折叠 // 文件是否折叠
resolvePlaceholder("fold-protocol", "foldProtocol", builder, element, parserContext); resolvePlaceholder("fold-protocol", "foldProtocol", builder, element, parserContext);
// 生成各种语言的协议列表 // 生成各种语言的协议列表
+1 -1
View File
@@ -65,7 +65,7 @@
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required"/> <xsd:attribute name="id" type="xsd:string" use="required"/>
<xsd:attribute name="protocol-location" type="xsd:string" use="required"/> <xsd:attribute name="protocol-location" type="xsd:string" use="required"/>
<xsd:attribute name="merger-protocol" type="xsd:boolean" default="false"/> <xsd:attribute name="merge-protocol" type="xsd:boolean" default="false"/>
<xsd:attribute name="fold-protocol" type="xsd:boolean" default="false"/> <xsd:attribute name="fold-protocol" type="xsd:boolean" default="false"/>
<xsd:attribute name="code-languages" type="xsd:string"/> <xsd:attribute name="code-languages" type="xsd:string"/>
<xsd:attribute name="protocol-path" type="xsd:string"/> <xsd:attribute name="protocol-path" type="xsd:string"/>