Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/game/StarPlayer.cpp4
-rw-r--r--source/game/StarPlayer.hpp32
2 files changed, 21 insertions, 15 deletions
diff --git a/source/game/StarPlayer.cpp b/source/game/StarPlayer.cpp
index 94ed991..9c9c482 100644
--- a/source/game/StarPlayer.cpp
+++ b/source/game/StarPlayer.cpp
@@ -2202,6 +2202,10 @@ pair<HumanoidEmote, float> Player::currentEmote() const {
return make_pair(m_emoteState, m_emoteCooldownTimer);
}
+Player::State Player::currentState() const {
+ return m_state;
+}
+
List<ChatAction> Player::pullPendingChatActions() {
return take(m_pendingChatActions);
}
diff --git a/source/game/StarPlayer.hpp b/source/game/StarPlayer.hpp
index d6750a5..871ca47 100644
--- a/source/game/StarPlayer.hpp
+++ b/source/game/StarPlayer.hpp
@@ -60,6 +60,21 @@ class Player :
public virtual EmoteEntity {
public:
+ enum class State {
+ Idle,
+ Walk,
+ Run,
+ Jump,
+ Fall,
+ Swim,
+ SwimIdle,
+ TeleportIn,
+ TeleportOut,
+ Crouch,
+ Lounge
+ };
+ static EnumMap<State> const StateNames;
+
Player(PlayerConfigPtr config, Uuid uuid = Uuid());
Player(PlayerConfigPtr config, ByteArray const& netStore);
Player(PlayerConfigPtr config, Json const& diskStore);
@@ -385,6 +400,8 @@ public:
void addEmote(HumanoidEmote const& emote, Maybe<float> emoteCooldown = {});
pair<HumanoidEmote, float> currentEmote() const;
+ State currentState() const;
+
List<ChatAction> pullPendingChatActions() override;
Maybe<String> inspectionLogName() const override;
@@ -483,21 +500,6 @@ public:
void setSecretProperty(String const& name, Json const& value);
private:
- enum class State {
- Idle,
- Walk,
- Run,
- Jump,
- Fall,
- Swim,
- SwimIdle,
- TeleportIn,
- TeleportOut,
- Crouch,
- Lounge
- };
- static EnumMap<State> const StateNames;
-
typedef LuaMessageHandlingComponent<LuaStorableComponent<LuaActorMovementComponent<LuaUpdatableComponent<LuaWorldComponent<LuaBaseComponent>>>>> GenericScriptComponent;
typedef shared_ptr<GenericScriptComponent> GenericScriptComponentPtr;