From 5a043841b520ce694ffeea3b2c255e6ad57a6c22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=94=E6=B0=91=E5=B0=8F=E9=95=87?= <262610965@qq.com> Date: Thu, 2 May 2024 16:29:17 +0800 Subject: [PATCH] :whale: --- .../game/action/skeleton/core/ActionCommandParser.java | 6 +++--- .../game/action/skeleton/core/BarSkeletonBuilder.java | 4 ++-- ...rActionActionTest.java => SimpleWrapperActionTest.java} | 6 +++--- .../game/action/skeleton/core/action/ExampleActionCmd.java | 1 - ...leWrapperActionAction.java => SimpleWrapperAction.java} | 7 +------ 5 files changed, 9 insertions(+), 15 deletions(-) rename common/common-core/src/test/java/com/iohao/game/action/skeleton/core/{SimpleWrapperActionActionTest.java => SimpleWrapperActionTest.java} (94%) rename common/common-core/src/test/java/com/iohao/game/action/skeleton/core/action/{SimpleWrapperActionAction.java => SimpleWrapperAction.java} (88%) diff --git a/common/common-core/src/main/java/com/iohao/game/action/skeleton/core/ActionCommandParser.java b/common/common-core/src/main/java/com/iohao/game/action/skeleton/core/ActionCommandParser.java index 2d3c080dd..79581e885 100644 --- a/common/common-core/src/main/java/com/iohao/game/action/skeleton/core/ActionCommandParser.java +++ b/common/common-core/src/main/java/com/iohao/game/action/skeleton/core/ActionCommandParser.java @@ -295,7 +295,7 @@ private void executeActionListeners() { final class ActionParserListeners { final List listeners = new CopyOnWriteArrayList<>(); - void addParserActionListener(ActionParserListener listener) { + void addActionParserListener(ActionParserListener listener) { this.listeners.add(listener); } @@ -314,8 +314,8 @@ public boolean isEmpty() { public ActionParserListeners() { // 监听器 - 预先创建协议代理类 if (DataCodecKit.getDataCodec() instanceof ProtoDataCodec) { - this.addParserActionListener(ProtobufActionParserListener.me()); - this.addParserActionListener(ProtobufCheckActionParserListener.me()); + this.addActionParserListener(ProtobufActionParserListener.me()); + this.addActionParserListener(ProtobufCheckActionParserListener.me()); } } } \ No newline at end of file diff --git a/common/common-core/src/main/java/com/iohao/game/action/skeleton/core/BarSkeletonBuilder.java b/common/common-core/src/main/java/com/iohao/game/action/skeleton/core/BarSkeletonBuilder.java index 9fda08108..37bb9c5a3 100644 --- a/common/common-core/src/main/java/com/iohao/game/action/skeleton/core/BarSkeletonBuilder.java +++ b/common/common-core/src/main/java/com/iohao/game/action/skeleton/core/BarSkeletonBuilder.java @@ -209,8 +209,8 @@ public BarSkeletonBuilder addRunner(Runner runner) { return this; } - public BarSkeletonBuilder addParserActionListener(ActionParserListener listener) { - this.actionParserListeners.addParserActionListener(listener); + public BarSkeletonBuilder addActionParserListener(ActionParserListener listener) { + this.actionParserListeners.addActionParserListener(listener); return this; } diff --git a/common/common-core/src/test/java/com/iohao/game/action/skeleton/core/SimpleWrapperActionActionTest.java b/common/common-core/src/test/java/com/iohao/game/action/skeleton/core/SimpleWrapperActionTest.java similarity index 94% rename from common/common-core/src/test/java/com/iohao/game/action/skeleton/core/SimpleWrapperActionActionTest.java rename to common/common-core/src/test/java/com/iohao/game/action/skeleton/core/SimpleWrapperActionTest.java index b4499e085..099a0f3ac 100644 --- a/common/common-core/src/test/java/com/iohao/game/action/skeleton/core/SimpleWrapperActionActionTest.java +++ b/common/common-core/src/test/java/com/iohao/game/action/skeleton/core/SimpleWrapperActionTest.java @@ -18,7 +18,7 @@ */ package com.iohao.game.action.skeleton.core; -import com.iohao.game.action.skeleton.core.action.SimpleWrapperActionAction; +import com.iohao.game.action.skeleton.core.action.SimpleWrapperAction; import com.iohao.game.action.skeleton.core.data.TestDataKit; import com.iohao.game.action.skeleton.core.flow.FlowContext; import com.iohao.game.action.skeleton.protocol.wrapper.IntValue; @@ -33,13 +33,13 @@ * @date 2024-05-02 */ @Slf4j -public class SimpleWrapperActionActionTest { +public class SimpleWrapperActionTest { BarSkeleton barSkeleton; @Before public void setUp() { - barSkeleton = TestDataKit.createBuilder(SimpleWrapperActionAction.class::equals).build(); + barSkeleton = TestDataKit.createBuilder(SimpleWrapperAction.class::equals).build(); } @Test diff --git a/common/common-core/src/test/java/com/iohao/game/action/skeleton/core/action/ExampleActionCmd.java b/common/common-core/src/test/java/com/iohao/game/action/skeleton/core/action/ExampleActionCmd.java index 83be86319..f6338eebd 100644 --- a/common/common-core/src/test/java/com/iohao/game/action/skeleton/core/action/ExampleActionCmd.java +++ b/common/common-core/src/test/java/com/iohao/game/action/skeleton/core/action/ExampleActionCmd.java @@ -89,6 +89,5 @@ interface WrapperLongActionCmd { interface SimpleWrapperActionActionCmd { int cmd = 13; int testInt = 0; - int testObject = 1; } } diff --git a/common/common-core/src/test/java/com/iohao/game/action/skeleton/core/action/SimpleWrapperActionAction.java b/common/common-core/src/test/java/com/iohao/game/action/skeleton/core/action/SimpleWrapperAction.java similarity index 88% rename from common/common-core/src/test/java/com/iohao/game/action/skeleton/core/action/SimpleWrapperActionAction.java rename to common/common-core/src/test/java/com/iohao/game/action/skeleton/core/action/SimpleWrapperAction.java index 0cdb7db57..89a6008c9 100644 --- a/common/common-core/src/test/java/com/iohao/game/action/skeleton/core/action/SimpleWrapperActionAction.java +++ b/common/common-core/src/test/java/com/iohao/game/action/skeleton/core/action/SimpleWrapperAction.java @@ -28,14 +28,9 @@ */ @Slf4j @ActionController(ExampleActionCmd.SimpleWrapperActionActionCmd.cmd) -public class SimpleWrapperActionAction { +public class SimpleWrapperAction { @ActionMethod(ExampleActionCmd.SimpleWrapperActionActionCmd.testInt) public void testInt(int age) { System.out.println(age); } - - @ActionMethod(ExampleActionCmd.SimpleWrapperActionActionCmd.testObject) - public int testObject() { - return 0; - } } \ No newline at end of file