diff --git a/GlobalUsings.cs b/GlobalUsings.cs
index 2516474..b454275 100644
--- a/GlobalUsings.cs
+++ b/GlobalUsings.cs
@@ -1,3 +1,5 @@
global using System;
+global using System.Collections;
+global using System.Collections.Generic;
global using System.Linq;
global using Godot;
diff --git a/Models/GodotPath.cs b/Helpers/GodotPath.cs
similarity index 100%
rename from Models/GodotPath.cs
rename to Helpers/GodotPath.cs
diff --git a/Helpers/TimeHelper.cs b/Helpers/TimeHelper.cs
index d719f7e..7662a1c 100644
--- a/Helpers/TimeHelper.cs
+++ b/Helpers/TimeHelper.cs
@@ -2,13 +2,17 @@ namespace CMSGame
{
static class TimeHelper
{
- /// 获取自引擎启动后经过的时间。
+ ///
+ /// 获取自引擎启动后经过的时间。
+ ///
public static double GetTicks()
{
return Time.GetTicksMsec() / 1000.0;
}
- /// 将时间(单位为秒)格式化为字符串“时:分:秒.毫秒”。
+ ///
+ /// 将时间(单位为秒)格式化为字符串“时:分:秒.毫秒”。
+ ///
public static string FormatTime(double time)
{
return TimeSpan.FromSeconds(time).ToString("c");
diff --git a/ModelData/BattleGoals.cs b/ModelData/BattleGoals.cs
index c95fcea..7885d35 100644
--- a/ModelData/BattleGoals.cs
+++ b/ModelData/BattleGoals.cs
@@ -1,28 +1,26 @@
-using System.Collections.Generic;
-
namespace CMSGame
{
public static class BattleGoals
{
- public static readonly BattleGoal Escape = new()
+ public static readonly Goal Escape = new()
{
Name = "保命要紧",
BasePriority = -50
};
- public static readonly BattleGoal SelfRegulatory = new()
+ public static readonly Goal SelfRegulatory = new()
{
Name = "自律行动",
BasePriority = 0
};
- public static readonly BattleGoal FollowOrder = new()
+ public static readonly Goal FollowOrder = new()
{
Name = "服从指令",
BasePriority = 50
};
- public static List AllGoals()
+ public static List> AllGoals()
{
return new() {
Escape,
diff --git a/Models/Action.cs b/Models/Base/Action.cs
similarity index 92%
rename from Models/Action.cs
rename to Models/Base/Action.cs
index ea1bae6..ea96607 100644
--- a/Models/Action.cs
+++ b/Models/Base/Action.cs
@@ -1,5 +1,3 @@
-using System.Collections.Generic;
-
namespace CMSGame
{
public abstract class Action
diff --git a/Models/Character.cs b/Models/Base/Character.cs
similarity index 100%
rename from Models/Character.cs
rename to Models/Base/Character.cs
diff --git a/Models/Effect.cs b/Models/Base/Effect.cs
similarity index 100%
rename from Models/Effect.cs
rename to Models/Base/Effect.cs
diff --git a/Models/Goal.cs b/Models/Base/Goal.cs
similarity index 89%
rename from Models/Goal.cs
rename to Models/Base/Goal.cs
index e0307dd..97d7267 100644
--- a/Models/Goal.cs
+++ b/Models/Base/Goal.cs
@@ -1,8 +1,6 @@
-using System.Collections.Generic;
-
namespace CMSGame
{
- public class Goal
+ public class Goal where TContext : IGoalContext
{
public string Name = string.Empty;
@@ -23,6 +21,11 @@ namespace CMSGame
}
}
+ public interface IGoalContext
+ {
+ IList ListActions();
+ }
+
public abstract class GoalModifier
{
public string Name = string.Empty;
diff --git a/Models/Base/Plan.cs b/Models/Base/Plan.cs
new file mode 100644
index 0000000..2f22e81
--- /dev/null
+++ b/Models/Base/Plan.cs
@@ -0,0 +1,7 @@
+namespace CMSGame
+{
+ public class Plan
+ {
+ public readonly List Actions = new();
+ }
+}
diff --git a/Models/Skill.cs b/Models/Base/Skill.cs
similarity index 100%
rename from Models/Skill.cs
rename to Models/Base/Skill.cs
diff --git a/Models/Battle.cs b/Models/Battle/Battle.cs
similarity index 100%
rename from Models/Battle.cs
rename to Models/Battle/Battle.cs
diff --git a/Models/BattleCharacter.cs b/Models/Battle/BattleCharacter.cs
similarity index 80%
rename from Models/BattleCharacter.cs
rename to Models/Battle/BattleCharacter.cs
index dd6aacf..97049ae 100644
--- a/Models/BattleCharacter.cs
+++ b/Models/Battle/BattleCharacter.cs
@@ -1,10 +1,8 @@
-using System.Collections.Generic;
-
namespace CMSGame
{
public class BattleCharacter
{
- public List Goals = new();
+ public List> Goals = new();
public Character Character;
diff --git a/Models/Battle/BattleContext.cs b/Models/Battle/BattleContext.cs
new file mode 100644
index 0000000..6a6e67e
--- /dev/null
+++ b/Models/Battle/BattleContext.cs
@@ -0,0 +1,10 @@
+namespace CMSGame
+{
+ public class BattleContext : IGoalContext
+ {
+ public IList ListActions()
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Models/BattleField.cs b/Models/Battle/BattleField.cs
similarity index 100%
rename from Models/BattleField.cs
rename to Models/Battle/BattleField.cs
diff --git a/Models/BattleFieldPosition.cs b/Models/Battle/BattleFieldPosition.cs
similarity index 100%
rename from Models/BattleFieldPosition.cs
rename to Models/Battle/BattleFieldPosition.cs
diff --git a/Models/BattleParty.cs b/Models/Battle/BattleParty.cs
similarity index 100%
rename from Models/BattleParty.cs
rename to Models/Battle/BattleParty.cs