1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 00:37:15 +01:00

Const cleanup.

This commit is contained in:
Sandu Liviu Catalin 2021-02-05 16:03:04 +02:00
parent 076d778e50
commit a6a9aa88b2
5 changed files with 27 additions and 27 deletions

View File

@ -194,7 +194,7 @@ public:
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Makes sure you can modify current entries. * Makes sure you can modify current entries.
*/ */
void ModifyEntries() void ModifyEntries() const
{ {
if (m_LockEntries) if (m_LockEntries)
{ {
@ -205,7 +205,7 @@ public:
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Makes sure you can modify current entries. * Makes sure you can modify current entries.
*/ */
void ModifyClasses() void ModifyClasses() const
{ {
if (m_LockClasses) if (m_LockClasses)
{ {
@ -216,7 +216,7 @@ public:
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Makes sure you can modify current entries. * Makes sure you can modify current entries.
*/ */
void ModifyUnits() void ModifyUnits() const
{ {
if (m_LockUnits) if (m_LockUnits)
{ {

View File

@ -162,7 +162,7 @@ void PvClass::AssignPrivilege(SQInteger id, SQInteger value)
DoChanged(id, r.Cast< bool >(), value); DoChanged(id, r.Cast< bool >(), value);
} }
} }
// Either waiy, we are setting this value // Either way, we are setting this value
mPrivileges[id] = value; mPrivileges[id] = value;
} }
@ -391,7 +391,7 @@ bool PvClass::HaveUnitWithTag(StackStrF & tag)
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void PvClass::EachEntryID(Object & ctx, Function & func) void PvClass::EachEntryID(Object & ctx, Function & func) const
{ {
// In order to be safe from modifications while iterating, create a copy // In order to be safe from modifications while iterating, create a copy
PvStatusList list(mPrivileges); PvStatusList list(mPrivileges);
@ -403,7 +403,7 @@ void PvClass::EachEntryID(Object & ctx, Function & func)
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void PvClass::EachUnitID(Object & ctx, Function & func) void PvClass::EachUnitID(Object & ctx, Function & func) const
{ {
// In order to be safe from modifications while iterating, create a copy // In order to be safe from modifications while iterating, create a copy
PvUnit::List list(mUnits); PvUnit::List list(mUnits);

View File

@ -300,12 +300,12 @@ struct PvClass
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Invoke a given callback with every owned entry identifier. * Invoke a given callback with every owned entry identifier.
*/ */
void EachEntryID(Object & ctx, Function & func); void EachEntryID(Object & ctx, Function & func) const;
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Invoke a given callback with every parented unit identifier. * Invoke a given callback with every parented unit identifier.
*/ */
void EachUnitID(Object & ctx, Function & func); void EachUnitID(Object & ctx, Function & func) const;
}; };
/* ------------------------------------------------------------------------------------------------ /* ------------------------------------------------------------------------------------------------
@ -356,21 +356,21 @@ struct SqPvClass
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
bool Can(LightObj & obj, SQInteger req) const; bool Can(LightObj & obj, SQInteger req) const;
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
void AssignPrivilegeWithID(SQInteger id, SQInteger value) { Valid().AssignPrivilege(id, value); } void AssignPrivilegeWithID(SQInteger id, SQInteger value) const { Valid().AssignPrivilege(id, value); }
void AssignPrivilegeWithTag(StackStrF & tag, SQInteger value) { Valid().AssignPrivilege(tag, value); } void AssignPrivilegeWithTag(StackStrF & tag, SQInteger value) const { Valid().AssignPrivilege(tag, value); }
void RemovePrivilegeWithID(SQInteger id) { Valid().RemovePrivilege(id); } void RemovePrivilegeWithID(SQInteger id) const { Valid().RemovePrivilege(id); }
void RemovePrivilegeWithTag(StackStrF & tag) { Valid().RemovePrivilege(tag); } void RemovePrivilegeWithTag(StackStrF & tag) const { Valid().RemovePrivilege(tag); }
void ModifyPrivilegeWithID(SQInteger id, SQInteger value) { Valid().ModifyPrivilege(id, value); } void ModifyPrivilegeWithID(SQInteger id, SQInteger value) const { Valid().ModifyPrivilege(id, value); }
void ModifyPrivilegeWithTag(StackStrF & tag, SQInteger value) { Valid().ModifyPrivilege(tag, value); } void ModifyPrivilegeWithTag(StackStrF & tag, SQInteger value) const { Valid().ModifyPrivilege(tag, value); }
void RemoveAllPrivileges() { Valid().RemoveAllPrivileges(); } void RemoveAllPrivileges() const { Valid().RemoveAllPrivileges(); }
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
SQMOD_NODISCARD LightObj GetUnitWithID(SQInteger id) const { return Valid().GetUnitWithID(id); } SQMOD_NODISCARD LightObj GetUnitWithID(SQInteger id) const { return Valid().GetUnitWithID(id); }
SQMOD_NODISCARD LightObj GetUnitWithTag(StackStrF & tag) const { return Valid().GetUnitWithTag(tag); } SQMOD_NODISCARD LightObj GetUnitWithTag(StackStrF & tag) const { return Valid().GetUnitWithTag(tag); }
SQMOD_NODISCARD bool HaveUnitWithID(SQInteger id) const { return Valid().HaveUnitWithID(id); } SQMOD_NODISCARD bool HaveUnitWithID(SQInteger id) const { return Valid().HaveUnitWithID(id); }
SQMOD_NODISCARD bool HaveUnitWithTag(StackStrF & tag) const { return Valid().HaveUnitWithTag(tag); } SQMOD_NODISCARD bool HaveUnitWithTag(StackStrF & tag) const { return Valid().HaveUnitWithTag(tag); }
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
void EachEntryID(Object & ctx, Function & func) { return Valid().EachEntryID(ctx, func); } void EachEntryID(Object & ctx, Function & func) const { return Valid().EachEntryID(ctx, func); }
void EachUnitID(Object & ctx, Function & func) { return Valid().EachUnitID(ctx, func); } void EachUnitID(Object & ctx, Function & func) const { return Valid().EachUnitID(ctx, func); }
}; };
} // Namespace:: SqMod } // Namespace:: SqMod

View File

@ -343,7 +343,7 @@ bool PvUnit::Can(SQInteger id, SQInteger req) const
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void PvUnit::EachEntryID(Object & ctx, Function & func) void PvUnit::EachEntryID(Object & ctx, Function & func) const
{ {
// In order to be safe from modifications while iterating, create a copy // In order to be safe from modifications while iterating, create a copy
PvStatusList list(mPrivileges); PvStatusList list(mPrivileges);

View File

@ -253,7 +253,7 @@ struct PvUnit
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Invoke a given callback with every owned entry identifier. * Invoke a given callback with every owned entry identifier.
*/ */
void EachEntryID(Object & ctx, Function & func); void EachEntryID(Object & ctx, Function & func) const;
}; };
/* ------------------------------------------------------------------------------------------------ /* ------------------------------------------------------------------------------------------------
@ -302,15 +302,15 @@ struct SqPvUnit
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
bool Can(LightObj & obj, SQInteger req) const; bool Can(LightObj & obj, SQInteger req) const;
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
void AssignPrivilegeWithID(SQInteger id, SQInteger value) { Valid().AssignPrivilege(id, value); } void AssignPrivilegeWithID(SQInteger id, SQInteger value) const { Valid().AssignPrivilege(id, value); }
void AssignPrivilegeWithTag(StackStrF & tag, SQInteger value) { Valid().AssignPrivilege(tag, value); } void AssignPrivilegeWithTag(StackStrF & tag, SQInteger value) const { Valid().AssignPrivilege(tag, value); }
void RemovePrivilegeWithID(SQInteger id) { Valid().RemovePrivilege(id); } void RemovePrivilegeWithID(SQInteger id) const { Valid().RemovePrivilege(id); }
void RemovePrivilegeWithTag(StackStrF & tag) { Valid().RemovePrivilege(tag); } void RemovePrivilegeWithTag(StackStrF & tag) const { Valid().RemovePrivilege(tag); }
void ModifyPrivilegeWithID(SQInteger id, SQInteger value) { Valid().ModifyPrivilege(id, value); } void ModifyPrivilegeWithID(SQInteger id, SQInteger value) const { Valid().ModifyPrivilege(id, value); }
void ModifyPrivilegeWithTag(StackStrF & tag, SQInteger value) { Valid().ModifyPrivilege(tag, value); } void ModifyPrivilegeWithTag(StackStrF & tag, SQInteger value) const { Valid().ModifyPrivilege(tag, value); }
void RemoveAllPrivileges() { Valid().RemoveAllPrivileges(); } void RemoveAllPrivileges() const { Valid().RemoveAllPrivileges(); }
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
void EachEntryID(Object & ctx, Function & func) { return Valid().EachEntryID(ctx, func); } void EachEntryID(Object & ctx, Function & func) const { return Valid().EachEntryID(ctx, func); }
}; };
} // Namespace:: SqMod } // Namespace:: SqMod