-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathentity.inl
More file actions
19 lines (17 loc) · 886 Bytes
/
entity.inl
File metadata and controls
19 lines (17 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
template<class DataType>
const DataType& Entity::getAttribute(const std::string& attribute) const
{
FEA_ASSERT(!mEntityManager.findEntity(mId).expired(), "Trying to set the attribute '" + attribute + "' on entity ID '" + std::to_string(mId) + "' which has previously been deleted!");
return mEntityManager.getAttribute<DataType>(mId, attribute);
}
template<class DataType>
DataType& Entity::getAttribute(const std::string& attribute)
{
FEA_ASSERT(!mEntityManager.findEntity(mId).expired(), "Trying to set the attribute '" + attribute + "' on entity ID '" + std::to_string(mId) + "' which has previously been deleted!");
return mEntityManager.getAttribute<DataType>(mId, attribute);
}
template<class DataType>
void Entity::setAttribute(const std::string& attribute, DataType value) const
{
mEntityManager.setAttribute<DataType>(mId, attribute, std::move(value));
}