-
Notifications
You must be signed in to change notification settings - Fork 3
Base objects
• The main class of the gameplay classes is a zCObject
. This is a smart-pointer object. Object will be deleted when refCtr
(count of references) is 0
. To above count of references use a AddRef()
method and Release()
to reduce. After creating default count is 1
. Dont use operator delete
directly to zCObject
and its childs.
zCVob* self = new zCVob(); // self's refCrt is 1
zCVob* other = self;
other->AddRef(); // self's and other's refCrt is 2
self->Release(); // self's and other's refCrt is 1
other->Release(); // self's and other's refCrt is 0 - object deleted
• This class and its childs can be written to archives (save files), for that zCObject
has two virtual methods: Archive()
for write and Unarchive()
for read.
• For easy cast object from one zCObject
class to other, use the CastTo<T>()
method.
zCVob* vob = player;
oCNpc* npc = player->CastTo<oCNpc>();
The class is used to automatically create instances of classes from save files. For that classes has a declarator macro zCLASS_DECLARATION
.
Factory is a static class to create some classes (and Non-zCObject) - vobs, npcs, worlds etc.
- Introduction
- Project hierarchy
- Default functions
- Build options
-
Gothic API
- Base objects
- Models and visuals
- Static and interactive objects
- Animations
- Interface
- Scripts
- Worlds
- Renderer
- Other
- User API
-
Union API
- Hook
- Hook Functions
- Array
- ArraySorted
- Map
- MapArray
- String
- Unicode string
- UTF-8 converter
- RowString
- Console
- Logger
- Message
- Thread
- Event
- Semaphore
- ThreadLocker
- Crc checker
- Options
- Timer
- Union
- VDFS functions
- VirtualFile
- Hooks
- dynamic_cast patch