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:
parent
076d778e50
commit
a6a9aa88b2
@ -194,7 +194,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Makes sure you can modify current entries.
|
||||
*/
|
||||
void ModifyEntries()
|
||||
void ModifyEntries() const
|
||||
{
|
||||
if (m_LockEntries)
|
||||
{
|
||||
@ -205,7 +205,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Makes sure you can modify current entries.
|
||||
*/
|
||||
void ModifyClasses()
|
||||
void ModifyClasses() const
|
||||
{
|
||||
if (m_LockClasses)
|
||||
{
|
||||
@ -216,7 +216,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Makes sure you can modify current entries.
|
||||
*/
|
||||
void ModifyUnits()
|
||||
void ModifyUnits() const
|
||||
{
|
||||
if (m_LockUnits)
|
||||
{
|
||||
|
@ -162,7 +162,7 @@ void PvClass::AssignPrivilege(SQInteger id, SQInteger value)
|
||||
DoChanged(id, r.Cast< bool >(), value);
|
||||
}
|
||||
}
|
||||
// Either waiy, we are setting this value
|
||||
// Either way, we are setting this 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
|
||||
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
|
||||
PvUnit::List list(mUnits);
|
||||
|
@ -300,12 +300,12 @@ struct PvClass
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* 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.
|
||||
*/
|
||||
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;
|
||||
// --------------------------------------------------------------------------------------------
|
||||
void AssignPrivilegeWithID(SQInteger id, SQInteger value) { Valid().AssignPrivilege(id, value); }
|
||||
void AssignPrivilegeWithTag(StackStrF & tag, SQInteger value) { Valid().AssignPrivilege(tag, value); }
|
||||
void RemovePrivilegeWithID(SQInteger id) { Valid().RemovePrivilege(id); }
|
||||
void RemovePrivilegeWithTag(StackStrF & tag) { Valid().RemovePrivilege(tag); }
|
||||
void ModifyPrivilegeWithID(SQInteger id, SQInteger value) { Valid().ModifyPrivilege(id, value); }
|
||||
void ModifyPrivilegeWithTag(StackStrF & tag, SQInteger value) { Valid().ModifyPrivilege(tag, value); }
|
||||
void RemoveAllPrivileges() { Valid().RemoveAllPrivileges(); }
|
||||
void AssignPrivilegeWithID(SQInteger id, SQInteger value) const { Valid().AssignPrivilege(id, value); }
|
||||
void AssignPrivilegeWithTag(StackStrF & tag, SQInteger value) const { Valid().AssignPrivilege(tag, value); }
|
||||
void RemovePrivilegeWithID(SQInteger id) const { Valid().RemovePrivilege(id); }
|
||||
void RemovePrivilegeWithTag(StackStrF & tag) const { Valid().RemovePrivilege(tag); }
|
||||
void ModifyPrivilegeWithID(SQInteger id, SQInteger value) const { Valid().ModifyPrivilege(id, value); }
|
||||
void ModifyPrivilegeWithTag(StackStrF & tag, SQInteger value) const { Valid().ModifyPrivilege(tag, value); }
|
||||
void RemoveAllPrivileges() const { Valid().RemoveAllPrivileges(); }
|
||||
// --------------------------------------------------------------------------------------------
|
||||
SQMOD_NODISCARD LightObj GetUnitWithID(SQInteger id) const { return Valid().GetUnitWithID(id); }
|
||||
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 HaveUnitWithTag(StackStrF & tag) const { return Valid().HaveUnitWithTag(tag); }
|
||||
// --------------------------------------------------------------------------------------------
|
||||
void EachEntryID(Object & ctx, Function & func) { return Valid().EachEntryID(ctx, func); }
|
||||
void EachUnitID(Object & ctx, Function & func) { return Valid().EachUnitID(ctx, func); }
|
||||
void EachEntryID(Object & ctx, Function & func) const { return Valid().EachEntryID(ctx, func); }
|
||||
void EachUnitID(Object & ctx, Function & func) const { return Valid().EachUnitID(ctx, func); }
|
||||
};
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
@ -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
|
||||
PvStatusList list(mPrivileges);
|
||||
|
@ -253,7 +253,7 @@ struct PvUnit
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* 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;
|
||||
// --------------------------------------------------------------------------------------------
|
||||
void AssignPrivilegeWithID(SQInteger id, SQInteger value) { Valid().AssignPrivilege(id, value); }
|
||||
void AssignPrivilegeWithTag(StackStrF & tag, SQInteger value) { Valid().AssignPrivilege(tag, value); }
|
||||
void RemovePrivilegeWithID(SQInteger id) { Valid().RemovePrivilege(id); }
|
||||
void RemovePrivilegeWithTag(StackStrF & tag) { Valid().RemovePrivilege(tag); }
|
||||
void ModifyPrivilegeWithID(SQInteger id, SQInteger value) { Valid().ModifyPrivilege(id, value); }
|
||||
void ModifyPrivilegeWithTag(StackStrF & tag, SQInteger value) { Valid().ModifyPrivilege(tag, value); }
|
||||
void RemoveAllPrivileges() { Valid().RemoveAllPrivileges(); }
|
||||
void AssignPrivilegeWithID(SQInteger id, SQInteger value) const { Valid().AssignPrivilege(id, value); }
|
||||
void AssignPrivilegeWithTag(StackStrF & tag, SQInteger value) const { Valid().AssignPrivilege(tag, value); }
|
||||
void RemovePrivilegeWithID(SQInteger id) const { Valid().RemovePrivilege(id); }
|
||||
void RemovePrivilegeWithTag(StackStrF & tag) const { Valid().RemovePrivilege(tag); }
|
||||
void ModifyPrivilegeWithID(SQInteger id, SQInteger value) const { Valid().ModifyPrivilege(id, value); }
|
||||
void ModifyPrivilegeWithTag(StackStrF & tag, SQInteger value) const { Valid().ModifyPrivilege(tag, value); }
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user