diff --git a/sources/Types/AcediaType.uc b/sources/Types/AcediaType.uc new file mode 100644 index 0000000..05179f7 --- /dev/null +++ b/sources/Types/AcediaType.uc @@ -0,0 +1,57 @@ +/** + * Object that is meant to describe meta-information about types (Acedia's + * and not). Currently a stub that stores class name. + * Copyright 2022 Anton Tarasenko + *------------------------------------------------------------------------------ + * This file is part of Acedia. + * + * Acedia is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3 of the License, or + * (at your option) any later version. + * + * Acedia is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Acedia. If not, see . + */ +class AcediaType extends AcediaObject; + +var protected class unrealClass; + +protected function Finalizer() +{ + unrealClass = none; +} + +/** + * Initialized box value. Can only be called once. + * + * @param boxValue Value to store in this reference. + * @return Reference to the caller `BoolBox` to allow for method chaining. + */ +public final function AcediaType Initialize(class sourceClass) +{ + if (unrealClass != none) { + return self; + } + unrealClass = sourceClass; + return self; +} + +public function bool IsEqual(Object other) +{ + local AcediaType otherType; + otherType = AcediaType(other); + if (otherType == none) { + return false; + } + return unrealClass == otherType.unrealClass; +} + +defaultproperties +{ +} \ No newline at end of file diff --git a/sources/Types/Boxes/BoxAPI.uc b/sources/Types/Boxes/BoxAPI.uc index b4ae913..e48ca57 100644 --- a/sources/Types/Boxes/BoxAPI.uc +++ b/sources/Types/Boxes/BoxAPI.uc @@ -165,6 +165,20 @@ public final function VectorArrayBox VectorArray(array arrayValue) return box; } +/** + * Creates initialized box that stores an `Vector` value. + * + * @param value Value to store in the box. + * @return `VectorBox`, containing `value`. + */ +public final function AcediaType Class(optional class value) +{ + local AcediaType box; + box = AcediaType(_.memory.Allocate(class'AcediaType')); + box.Initialize(value); + return box; +} + defaultproperties { } \ No newline at end of file