aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/ai/je_state_machine.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-10-27 08:31:00 +0800
committerchai <chaifix@163.com>2018-10-27 08:31:00 +0800
commit73c42ddcc4eeb6ac3f0282d2c08ae8e632f3355f (patch)
treeeeddce1725b9d6f81693d2ae99f665226d7a9d24 /src/libjin/ai/je_state_machine.h
parente21485a60da2b304a0d529d72e9a47061a3f9502 (diff)
*修改boot.lua
Diffstat (limited to 'src/libjin/ai/je_state_machine.h')
-rw-r--r--src/libjin/ai/je_state_machine.h81
1 files changed, 43 insertions, 38 deletions
diff --git a/src/libjin/ai/je_state_machine.h b/src/libjin/ai/je_state_machine.h
index 71bf7ba..7b199ac 100644
--- a/src/libjin/ai/je_state_machine.h
+++ b/src/libjin/ai/je_state_machine.h
@@ -23,31 +23,6 @@ namespace JinEngine
{
public:
- union ParameterValue
- {
- int _int;
- float _float;
- bool _bool;
- byte _trigger;
- };
-
- enum ParameterType
- {
- Int, ///< A integer value.
- FLoat, ///< A float value.
- Bool, ///< A bool value.
- Trigger ///< A trigger will be reset to false after activated.
- };
-
- ///
- /// Traslation's condition.
- ///
- struct Condition
- {
- std::string parameter;
- ParameterValue value;
- };
-
///
///
///
@@ -81,17 +56,27 @@ namespace JinEngine
///
///
///
- void addParameter(ParameterType type, const std::string& name);
+ void addParameteri(const std::string& name);
- ///
- /// Add a state.
- ///
- void addState(const std::string& name);
+ ///
+ ///
+ ///
+ void addParameterf(const std::string& name);
///
///
///
- void addTransition(const std::string& stateFrom, const std::string& stateTo, const std::string& name, const ParameterValue& value);
+ void addParameterb(const std::string& name);
+
+ ///
+ ///
+ ///
+ void addParametert(const std::string& name);
+
+ ///
+ /// Add a state.
+ ///
+ void addState(const std::string& name);
///
///
@@ -116,11 +101,6 @@ namespace JinEngine
///
/// Set parameter value.
///
- void setParameter(const std::string& name, const ParameterValue& value);
-
- ///
- /// Set parameter value.
- ///
void setParameteri(const std::string& name, int value);
///
@@ -151,7 +131,7 @@ namespace JinEngine
///
/// Reset state machine.
///
- void resetState();
+ void reset();
///
///
@@ -170,19 +150,44 @@ namespace JinEngine
private:
+ enum ParameterType
+ {
+ Int, ///< A integer value.
+ FLoat, ///< A float value.
+ Bool, ///< A bool value.
+ Trigger ///< A trigger will be reset to false after activated.
+ };
+
+ union ParameterValue
+ {
+ int _int;
+ float _float;
+ bool _bool;
+ byte _trigger;
+ };
+
struct Parameter
{
ParameterType type;
ParameterValue value;
};
+ ///
+ /// Traslation's condition.
+ ///
+ struct Condition
+ {
+ std::string parameter;
+ ParameterValue value;
+ };
+
///
/// Translate to another state.
///
struct Transition
{
Condition condition; ///< Condition to active transition.
- std::string& state; ///<
+ std::string state; ///<
};
///