Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix spelling mistake #398

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions engine/source/runtime/function/framework/object/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ namespace Piccolo
}
}

bool GObject::hasComponent(const std::string& compenent_type_name) const
bool GObject::hasComponent(const std::string& component_type_name) const
{
for (const auto& component : m_components)
{
if (component.getTypeName() == compenent_type_name)
if (component.getTypeName() == component_type_name)
return true;
}

Expand Down
10 changes: 5 additions & 5 deletions engine/source/runtime/function/framework/object/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ namespace Piccolo
void setName(std::string name) { m_name = name; }
const std::string& getName() const { return m_name; }

bool hasComponent(const std::string& compenent_type_name) const;
bool hasComponent(const std::string& component_type_name) const;

std::vector<Reflection::ReflectionPtr<Component>> getComponents() { return m_components; }

template<typename TComponent>
TComponent* tryGetComponent(const std::string& compenent_type_name)
TComponent* tryGetComponent(const std::string& component_type_name)
{
for (auto& component : m_components)
{
if (component.getTypeName() == compenent_type_name)
if (component.getTypeName() == component_type_name)
{
return static_cast<TComponent*>(component.operator->());
}
Expand All @@ -50,11 +50,11 @@ namespace Piccolo
}

template<typename TComponent>
const TComponent* tryGetComponentConst(const std::string& compenent_type_name) const
const TComponent* tryGetComponentConst(const std::string& component_type_name) const
{
for (const auto& component : m_components)
{
if (component.getTypeName() == compenent_type_name)
if (component.getTypeName() == component_type_name)
{
return static_cast<const TComponent*>(component.operator->());
}
Expand Down