BEEP-8 Helper Lib 1.0.0
Loading...
Searching...
No Matches
cobj.h File Reference

Header file for managing dynamic creation and destruction of objects in a game. More...

#include <b8/type.h>
#include <b8/assert.h>
#include <b8/ppu.h>
#include <b8/misc.h>
#include <handle.h>
#include <vector>

Go to the source code of this file.

Classes

class  CObj
 
class  Handle< T >
 

Typedefs

typedef unsigned long HObj
 

Functions

void CObjHolder_Reset ()
 
HObj CObjHolder_Entry (CObj *obj, u32 priority)
 
void CObjHolder_Remove (HObj hObj)
 
void CObjHolder_Enum (std::vector< HObj > &dest_, u32 prio_, u32 type_id_)
 
void CObjHolder_Step (b8PpuCmd *cmd_)
 
void CObjHolder_Pause (s32 cnt_pause_)
 
CObjcobj (HObj hObj)
 

Detailed Description

Header file for managing dynamic creation and destruction of objects in a game.

This file defines the CObj class, which is used to manage the dynamic creation and destruction of objects, such as those found in games. It provides an interface for handling object lifecycle, including step processing, drawing, touch handling, and priority-based management.

The CObj class includes mechanisms to handle object identifiers, priority levels, and type identification, allowing for organized and efficient management of game objects.

Usage:

#include <cobj.h>
// Reset object holder
CObjHolder_Reset();
// Create and register a new object
MyCObj* obj = new MyCObj();
HObj hObj = CObjHolder_Entry(obj, priority);
// Perform game loop operations
while (gameRunning) {
CObjHolder_Step(cmd);
}
// Remove and delete the object
CObjHolder_Remove(hObj);
delete obj;
Header file for managing dynamic creation and destruction of objects in a game.