mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-07-14 00:55:54 +00:00
CGameTemplate: Mark getter functions as const
These don't modify internal class state, so we can mark them as const.
This commit is contained in:
parent
15708b8624
commit
f942ad6551
@ -159,7 +159,7 @@ CScriptTemplate* CGameTemplate::TemplateByIndex(uint32 Index)
|
|||||||
return (std::next(it, Index))->second.pTemplate.get();
|
return (std::next(it, Index))->second.pTemplate.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
SState CGameTemplate::StateByID(uint32 StateID)
|
SState CGameTemplate::StateByID(uint32 StateID) const
|
||||||
{
|
{
|
||||||
const auto iter = mStates.find(StateID);
|
const auto iter = mStates.find(StateID);
|
||||||
|
|
||||||
@ -169,19 +169,19 @@ SState CGameTemplate::StateByID(uint32 StateID)
|
|||||||
return SState(iter->first, iter->second);
|
return SState(iter->first, iter->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
SState CGameTemplate::StateByID(const CFourCC& State)
|
SState CGameTemplate::StateByID(const CFourCC& State) const
|
||||||
{
|
{
|
||||||
return StateByID(State.ToLong());
|
return StateByID(State.ToLong());
|
||||||
}
|
}
|
||||||
|
|
||||||
SState CGameTemplate::StateByIndex(uint32 Index)
|
SState CGameTemplate::StateByIndex(uint32 Index) const
|
||||||
{
|
{
|
||||||
auto Iter = mStates.begin();
|
auto Iter = mStates.begin();
|
||||||
Iter = std::next(Iter, Index);
|
Iter = std::next(Iter, Index);
|
||||||
return SState(Iter->first, Iter->second);
|
return SState(Iter->first, Iter->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
SMessage CGameTemplate::MessageByID(uint32 MessageID)
|
SMessage CGameTemplate::MessageByID(uint32 MessageID) const
|
||||||
{
|
{
|
||||||
const auto iter = mMessages.find(MessageID);
|
const auto iter = mMessages.find(MessageID);
|
||||||
|
|
||||||
@ -191,12 +191,12 @@ SMessage CGameTemplate::MessageByID(uint32 MessageID)
|
|||||||
return SMessage(iter->first, iter->second);
|
return SMessage(iter->first, iter->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
SMessage CGameTemplate::MessageByID(const CFourCC& MessageID)
|
SMessage CGameTemplate::MessageByID(const CFourCC& MessageID) const
|
||||||
{
|
{
|
||||||
return MessageByID(MessageID.ToLong());
|
return MessageByID(MessageID.ToLong());
|
||||||
}
|
}
|
||||||
|
|
||||||
SMessage CGameTemplate::MessageByIndex(uint32 Index)
|
SMessage CGameTemplate::MessageByIndex(uint32 Index) const
|
||||||
{
|
{
|
||||||
auto Iter = mMessages.begin();
|
auto Iter = mMessages.begin();
|
||||||
Iter = std::next(Iter, Index);
|
Iter = std::next(Iter, Index);
|
||||||
@ -225,7 +225,7 @@ IProperty* CGameTemplate::FindPropertyArchetype(const TString& kTypeName)
|
|||||||
return Path.pTemplate.get();
|
return Path.pTemplate.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
TString CGameTemplate::GetPropertyArchetypeFilePath(const TString& kTypeName)
|
TString CGameTemplate::GetPropertyArchetypeFilePath(const TString& kTypeName) const
|
||||||
{
|
{
|
||||||
const auto it = mPropertyTemplates.find(kTypeName);
|
const auto it = mPropertyTemplates.find(kTypeName);
|
||||||
ASSERT(it != mPropertyTemplates.cend());
|
ASSERT(it != mPropertyTemplates.cend());
|
||||||
|
@ -94,14 +94,14 @@ public:
|
|||||||
CScriptTemplate* TemplateByID(uint32 ObjectID);
|
CScriptTemplate* TemplateByID(uint32 ObjectID);
|
||||||
CScriptTemplate* TemplateByID(const CFourCC& ObjectID);
|
CScriptTemplate* TemplateByID(const CFourCC& ObjectID);
|
||||||
CScriptTemplate* TemplateByIndex(uint32 Index);
|
CScriptTemplate* TemplateByIndex(uint32 Index);
|
||||||
SState StateByID(uint32 StateID);
|
SState StateByID(uint32 StateID) const;
|
||||||
SState StateByID(const CFourCC& StateID);
|
SState StateByID(const CFourCC& StateID) const;
|
||||||
SState StateByIndex(uint32 Index);
|
SState StateByIndex(uint32 Index) const;
|
||||||
SMessage MessageByID(uint32 MessageID);
|
SMessage MessageByID(uint32 MessageID) const;
|
||||||
SMessage MessageByID(const CFourCC& MessageID);
|
SMessage MessageByID(const CFourCC& MessageID) const;
|
||||||
SMessage MessageByIndex(uint32 Index);
|
SMessage MessageByIndex(uint32 Index) const;
|
||||||
IProperty* FindPropertyArchetype(const TString& kTypeName);
|
IProperty* FindPropertyArchetype(const TString& kTypeName);
|
||||||
TString GetPropertyArchetypeFilePath(const TString& kTypeName);
|
TString GetPropertyArchetypeFilePath(const TString& kTypeName) const;
|
||||||
bool RenamePropertyArchetype(const TString& kTypeName, const TString& kNewTypeName);
|
bool RenamePropertyArchetype(const TString& kTypeName, const TString& kNewTypeName);
|
||||||
CScriptTemplate* FindMiscTemplate(const TString& kTemplateName);
|
CScriptTemplate* FindMiscTemplate(const TString& kTemplateName);
|
||||||
TString GetGameDirectory() const;
|
TString GetGameDirectory() const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user