Skip to content

Commit

Permalink
#5907: remove non-const getAttribute() from IEntity public interface
Browse files Browse the repository at this point in the history
This method is still needed on EntityClass since it is used internally,
but is no longer used from elsewhere in the code.
  • Loading branch information
Matthew Mott committed Mar 16, 2022
1 parent f3efe94 commit 2166c37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
17 changes: 0 additions & 17 deletions include/ieclass.h
Expand Up @@ -160,23 +160,6 @@ class IEntityClass :

/* ENTITY CLASS ATTRIBUTES */

/**
* Return a single named EntityClassAttribute from this EntityClass.
*
* \param name
* The name of the EntityClassAttribute to find, interpreted case-insensitively.
*
* \param includeInherited
* true if attributes inherited from parent entity classes should be
* considered, false otherwise.
*
* \return
* A reference to the named EntityClassAttribute. If the named attribute is
* not found, an empty EntityClassAttribute is returned.
*/
virtual EntityClassAttribute& getAttribute(const std::string& name,
bool includeInherited = true) = 0;

/// Get a const EntityClassAttribute reference by name
virtual const EntityClassAttribute& getAttribute(const std::string& name,
bool includeInherited = true) const = 0;
Expand Down
4 changes: 3 additions & 1 deletion radiantcore/eclass/EntityClass.h
Expand Up @@ -90,6 +90,9 @@ class EntityClass
void forEachAttributeInternal(InternalAttrVisitor visitor,
bool editorKeys) const;

// Non-const attribute access
EntityClassAttribute& getAttribute(const std::string&, bool includeInherited = true);

public:

/// Construct an EntityClass with no FileInfo.
Expand All @@ -115,7 +118,6 @@ class EntityClass
void setColour(const Vector4& colour) override;
// Resets the colour to the value defined in the attributes
void resetColour();
EntityClassAttribute& getAttribute(const std::string&, bool includeInherited = true) override;
const EntityClassAttribute& getAttribute(const std::string&, bool includeInherited = true) const override;
std::string getAttributeValue(const std::string&, bool includeInherited = true) const override;
const std::string& getAttributeType(const std::string& name) const override;
Expand Down

0 comments on commit 2166c37

Please sign in to comment.