SAGE
A Simple Academic Game Engine
Loading...
Searching...
No Matches
Sage::CObject Class Reference

A basic game object. More...

#include <SageObject.h>

Inheritance diagram for Sage::CObject:
Collaboration diagram for Sage::CObject:

Public Member Functions

void MarkForDeletion ()
 Mark as ready for deletion.
 
const bool MarkedForDeletion () const
 Is marked for deletion.
 

Private Attributes

bool m_bMarkedForDeletion = false
 Is ready to delete from object list.
 

Additional Inherited Members

- Static Protected Attributes inherited from Sage::CComponent
static std::unique_ptr< CTimerm_pTimer = std::make_unique<CTimer>()
 Pointer to a timer.
 
static std::unique_ptr< CRandomm_pRandom = std::make_unique<CRandom>()
 Pointer to a PRNG.
 
static std::unique_ptr< CSoundm_pSound = std::make_unique<CSound>()
 Pointer to sound manager.
 
static std::unique_ptr< CKeyboardm_pKeyboard
 Pointer to a keyboard handler.
 
static std::unique_ptr< CMousem_pMouse = std::make_unique<CMouse>()
 Pointer to a mouse handler.
 
static std::unique_ptr< CControllerm_pController
 Pointer to a controller.
 

Detailed Description

CObject is a basic object containing the necessary functions and data for being a member of an object list, plus virtual function stubs for moving and drawing during animation. You should derive the object classes in your game from this class. It is designed for use with an object manager derived from CObjectManager. If you call MarkForDeletion when this object is dead, then CObjectManager will delete it from the object list at the end of the frame.

Member Function Documentation

◆ MarkedForDeletion()

const bool CObject::MarkedForDeletion ( ) const

Reader function for the member variable m_bMarkedForDeletion.

Returns
true if marked for deletion from the object list.

◆ MarkForDeletion()

void CObject::MarkForDeletion ( )

Mark as ready for deletion by setting m_bMarkedForDeletion to true.