1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-01-31 09:57:14 +01:00

Adjust the Checkpoint entity methods to use the new method of receiving formatted strings.

This commit is contained in:
Sandu Liviu Catalin 2016-11-16 14:48:19 +02:00
parent 85079a28d2
commit 5669802169
2 changed files with 23 additions and 3 deletions

View File

@ -64,9 +64,23 @@ const String & CCheckpoint::GetTag() const
}
// ------------------------------------------------------------------------------------------------
void CCheckpoint::SetTag(CSStr tag)
void CCheckpoint::SetTag(const StackStrF & tag)
{
m_Tag.assign(tag);
if (tag.mLen > 0)
{
m_Tag.assign(tag.mPtr, tag.mLen);
}
else
{
m_Tag.clear();
}
}
// ------------------------------------------------------------------------------------------------
CCheckpoint & CCheckpoint::ApplyTag(StackStrF & tag)
{
SetTag(tag);
return *this;
}
// ------------------------------------------------------------------------------------------------
@ -521,6 +535,7 @@ void Register_CCheckpoint(HSQUIRRELVM vm)
.Prop(_SC("Active"), &CCheckpoint::IsActive)
// Core Methods
.Func(_SC("Bind"), &CCheckpoint::BindEvent)
.FmtFunc(_SC("SetTag"), &CCheckpoint::ApplyTag)
.Func(_SC("CustomEvent"), &CCheckpoint::CustomEvent)
// Core Overloads
.Overload< bool (CCheckpoint::*)(void) >(_SC("Destroy"), &CCheckpoint::Destroy)

View File

@ -140,7 +140,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the associated user tag.
*/
void SetTag(CSStr tag);
void SetTag(const StackStrF & tag);
/* --------------------------------------------------------------------------------------------
* Modify the associated user tag.
*/
CCheckpoint & ApplyTag(StackStrF & tag);
/* --------------------------------------------------------------------------------------------
* Retrieve the associated user data.