GetLocalObject

NWObject
GetLocalObject
(
ST
)
(
ref ST oObject
,
NWString sVarName
)

Examples

import std.math;
immutable dogeUtc = cast(immutable ubyte[])import("doge.utc");
{
	auto obj = new nwn.gff.Gff(dogeUtc).root;

	SetLocalInt(obj, "TestInt", 5);
	SetLocalFloat(obj, "TestFloat", 5.3);
	SetLocalString(obj, "TestString", "Hello");

	assert(GetLocalInt(obj, "TestInt") == 5);

	assert(approxEqual(GetLocalFloat(obj, "TestFloat"), 5.3f));
	assert(GetLocalString(obj, "TestString") == "Hello");
	assert(GetLocalString(obj, "yolooo") == "");
	assert(GetLocalObject(obj, "TestInt") == OBJECT_INVALID);

	DeleteLocalInt(obj, "TestString");
	assert(GetLocalString(obj, "TestString") == "Hello");
	DeleteLocalString(obj, "TestString");
	assert(GetLocalString(obj, "TestString") == "");
}
{
	auto obj = new nwn.fastgff.FastGff(dogeUtc).root;
	assert(GetLocalInt(obj, "aaabbb") == 0);
}

Meta