We can create decorators but not do anything with them in script. Ideally we would want:
- Ability to walk all variables of a class and read presence or absence of a decorator and the values.
- Perform work on a decorated object.
- Know which object the decorator was applied.
In the example below, there does not appear methods to do anything with the values other than on creation of the object, and we have no methods to know what object called the decorator or pass back.
class TestClassDecorator { int x; void TestClassDecorator(int _x) { x = _x; Print(ToString() + " " + x + " " + ClassName() + " " + Type()); } } class TestPropertyDecorator { int y; void TestPropertyDecorator(int _y) { y = _y; Print(ToString() + " " + y + " " + ClassName() + " " + Type()); } } [TestClassDecorator(1)] class TestDecorateMe { [TestPropertyDecorator(2)] int test = 0; void TestDecorateMe() { Print(ToString() + " " + test + " " + ClassName() + " " + Type()); } void ~TestDecorateMe() {} } ref TestDecorateMe g_TestMe = new TestDecorateMe(); modded class DayZGame { void DayZGame() { g_TestMe.test++; Print(g_TestMe.ToString() + " " + g_TestMe.test + " " + g_TestMe.ClassName() + " " + g_TestMe.Type()); } void ~DayZGame() {} }
OUTPUT:
SCRIPT : TestDecorateMe<9fe89960> 0 TestDecorateMe TestDecorateMe SCRIPT : TestClassDecorator<a09a80f0> 1 TestClassDecorator TestClassDecorator SCRIPT : TestPropertyDecorator<a09a7170> 2 TestPropertyDecorator TestPropertyDecorator SCRIPT : TestDecorateMe<9fe89960> 1 TestDecorateMe TestDecorateMe