mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-09 17:08:06 +00:00
Use better API terminology for radii
- SetProximityRadius just calls AddProximityRadius so its clear what is going on. - created struct BoxDimensions for clear reading of what the floats are
This commit is contained in:
@@ -559,17 +559,14 @@ void Entity::IsGhosted() {
|
||||
}
|
||||
}
|
||||
|
||||
// Move to header
|
||||
bool Entity::operator==(const Entity& other) const {
|
||||
return other.m_ObjectID == m_ObjectID;
|
||||
}
|
||||
|
||||
// Move to header
|
||||
bool Entity::operator!=(const Entity& other) const {
|
||||
return !(other.m_ObjectID == m_ObjectID);
|
||||
}
|
||||
|
||||
// Move to header
|
||||
bool Entity::HasComponent(const eReplicaComponentType componentId) const {
|
||||
return m_Components.find(componentId) != m_Components.end();
|
||||
}
|
||||
@@ -593,15 +590,15 @@ void Entity::Unsubscribe(CppScripts::Script* scriptToRemove, const std::string&
|
||||
}
|
||||
|
||||
// Fine
|
||||
void Entity::SetProximityRadius(const float proxRadius, const std::string& name) {
|
||||
void Entity::AddProximityRadius(const float proxRadius, const std::string& name) {
|
||||
auto* proximityMonitorComponent = AddComponent<ProximityMonitorComponent>();
|
||||
if (proximityMonitorComponent) proximityMonitorComponent->SetProximityRadius(proxRadius, name);
|
||||
if (proximityMonitorComponent) proximityMonitorComponent->AddProximityRadius(proxRadius, name);
|
||||
}
|
||||
|
||||
// Remove in favor of a square constructor
|
||||
void Entity::SetProximityRadius(dpEntity* entity, const std::string& name) {
|
||||
void Entity::AddProximityRadius(const BoxDimensions& dimensions, const std::string& name) {
|
||||
auto* proximityMonitorComponent = AddComponent<ProximityMonitorComponent>();
|
||||
if (proximityMonitorComponent) proximityMonitorComponent->SetProximityRadius(entity, name);
|
||||
if (proximityMonitorComponent) proximityMonitorComponent->AddProximityRadius(dimensions, name);
|
||||
}
|
||||
|
||||
void Entity::SetGMLevel(eGameMasterLevel value) {
|
||||
|
@@ -35,6 +35,7 @@ class Item;
|
||||
class Character;
|
||||
class EntityCallbackTimer;
|
||||
class LDFBaseData;
|
||||
class BoxDimensions;
|
||||
enum class eTriggerEventType;
|
||||
enum class eGameMasterLevel : uint8_t;
|
||||
enum class eReplicaComponentType : uint32_t;
|
||||
@@ -168,9 +169,14 @@ public:
|
||||
* no longer be notified of notificationName events
|
||||
*/
|
||||
void Unsubscribe(CppScripts::Script* scriptToRemove, const std::string& notificationName);
|
||||
// ### STOPPED HERE ###
|
||||
void SetProximityRadius(const float proxRadius, const std::string& name);
|
||||
void SetProximityRadius(dpEntity* entity, const std::string& name);
|
||||
|
||||
void AddProximityRadius(const float proxRadius, const std::string& name);
|
||||
void AddProximityRadius(const BoxDimensions& dimensions, const std::string& name);
|
||||
|
||||
// Technically this is the live accrate API, however what it does is not setting the proximity radius, but rather
|
||||
// adding a new one to the list of proximity radii. For that reason we will have the old API just call AddProximityRadius.
|
||||
inline void SetProximityRadius(const float proxRadius, const std::string& name) { this->AddProximityRadius(proxRadius, name); }
|
||||
inline void SetProximityRadius(const BoxDimensions& dimensions, const std::string& name) { this->AddProximityRadius(dimensions, name); }
|
||||
|
||||
void AddChild(Entity* child);
|
||||
void RemoveChild(Entity* child);
|
||||
|
Reference in New Issue
Block a user