ref[csharp]: refactor generate csharp protocol

This commit is contained in:
godotg
2024-05-22 16:04:12 +08:00
parent 7fedbe547e
commit ab3ca0e17a
4 changed files with 8 additions and 8 deletions
@@ -27,7 +27,7 @@ public class NetConfig {
/**
* {@link GenerateOperation}
*/
private boolean mergerProtocol;
private boolean mergeProtocol;
/**
* {@link GenerateOperation}
*/
@@ -81,12 +81,12 @@ public class NetConfig {
this.protocolLocation = protocolLocation;
}
public boolean isMergerProtocol() {
return mergerProtocol;
public boolean isMergeProtocol() {
return mergeProtocol;
}
public void setMergerProtocol(boolean mergerProtocol) {
this.mergerProtocol = mergerProtocol;
public void setMergeProtocol(boolean mergeProtocol) {
this.mergeProtocol = mergeProtocol;
}
public boolean isFoldProtocol() {
@@ -92,7 +92,7 @@ public class PacketService implements IPacketService {
var protocolLocation = netConfig.getProtocolLocation();
var generateOperation = new GenerateOperation();
generateOperation.setMergeProtocol(netConfig.isMergerProtocol());
generateOperation.setMergeProtocol(netConfig.isMergeProtocol());
generateOperation.setFoldProtocol(netConfig.isFoldProtocol());
generateOperation.setProtocolPath(netConfig.getProtocolPath());
generateOperation.setProtocolParam(netConfig.getProtocolParam());
@@ -102,7 +102,7 @@ public class NetDefinitionParser implements BeanDefinitionParser {
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);
// 生成各种语言的协议列表
+1 -1
View File
@@ -65,7 +65,7 @@
</xsd:sequence>
<xsd:attribute name="id" 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="code-languages" type="xsd:string"/>
<xsd:attribute name="protocol-path" type="xsd:string"/>