mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-30 01:41:40 +00:00
feat(activity): GetActivityUser, the first player with activity data
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -275,6 +275,10 @@ float_t ActivityComponent::GetActivityValue(LWOOBJID playerID, uint32_t index) c
|
||||
return value;
|
||||
}
|
||||
|
||||
LWOOBJID ActivityComponent::GetActivityUser() const {
|
||||
return m_ActivityPlayers.empty() ? LWOOBJID_EMPTY : m_ActivityPlayers.begin()->first;
|
||||
}
|
||||
|
||||
void ActivityComponent::SetActivityValue(LWOOBJID playerID, uint32_t index, float_t value) {
|
||||
auto& data = m_ActivityPlayers[playerID];
|
||||
data[std::min(index, static_cast<uint32_t>(9))] = value;
|
||||
|
||||
@@ -268,6 +268,11 @@ public:
|
||||
*/
|
||||
float_t GetActivityValue(LWOOBJID playerID, uint32_t index) const;
|
||||
|
||||
/**
|
||||
* The activity's user (GetActivityUser): the first player with activity data, or LWOOBJID_EMPTY when none has any
|
||||
*/
|
||||
LWOOBJID GetActivityUser() const;
|
||||
|
||||
/**
|
||||
* Removes activity score tracking for some entity
|
||||
* @param playerID the entity to remove score for
|
||||
|
||||
Reference in New Issue
Block a user