2009-05-08 13:28:41 +00:00
/*
* OpenClonk , http : //www.openclonk.org
*
2013-12-17 20:01:09 +00:00
* Copyright ( c ) 2001 - 2009 , RedWolf Design GmbH , http : //www.clonk.de/
* Copyright ( c ) 2009 - 2013 , The OpenClonk Team and contributors
2009-05-08 13:28:41 +00:00
*
2013-12-17 20:01:09 +00:00
* Distributed under the terms of the ISC license ; see accompanying file
* " COPYING " for details .
2009-05-08 13:28:41 +00:00
*
2013-12-17 20:01:09 +00:00
* " Clonk " is a registered trademark of Matthes Bender , used with permission .
* See accompanying file " TRADEMARK " for details .
2009-05-08 13:28:41 +00:00
*
2013-12-17 20:01:09 +00:00
* To redistribute this file separately , substitute the full license texts
* for the above references .
2009-05-08 13:28:41 +00:00
*/
// game object lists
# ifndef INC_C4GameObjects
# define INC_C4GameObjects
# include <C4ObjectList.h>
# include <C4FindObject.h>
# include <C4Sector.h>
// main object list class
class C4GameObjects : public C4NotifyingObjectList
2010-03-28 17:58:21 +00:00
{
public :
C4GameObjects ( ) ; // constructor
~ C4GameObjects ( ) ; // destructor
void Default ( ) ;
void Init ( int32_t iWidth , int32_t iHeight ) ;
void Clear ( bool fClearInactive ) ; // clear objects
2013-12-14 17:16:39 +00:00
// don't use default parameters so we get a correct vtbl entry
// don't clear internal objects, because they should not be cleared on section load
void Clear ( ) { Clear ( false ) ; }
2010-03-28 17:58:21 +00:00
2013-08-10 20:31:33 +00:00
private :
uint32_t LastUsedMarker ; // last used value for C4Object::Marker
2010-03-28 17:58:21 +00:00
public :
C4LSectors Sectors ; // section object lists
C4ObjectList InactiveObjects ; // inactive objects (Status=2)
C4ObjectList ForeObjects ; // objects in foreground (C4D_Foreground)
using C4ObjectList : : Add ;
bool Add ( C4Object * nObj ) ; // add object
bool Remove ( C4Object * pObj ) ; // clear pointers to object
C4ObjectList & ObjectsAt ( int ix , int iy ) ; // get object list for map pos
void CrossCheck ( ) ; // various collision-checks
C4Object * AtObject ( int ctx , int cty , DWORD & ocf , C4Object * exclude = NULL ) ; // find object at ctx/cty
void Synchronize ( ) ; // network synchronization
2010-04-20 20:38:18 +00:00
void UpdateSolidMasks ( ) ;
2010-03-28 17:58:21 +00:00
2013-02-13 17:06:31 +00:00
C4Object * ObjectPointer ( int32_t iNumber ) ; // object pointer by number
2010-03-28 17:58:21 +00:00
C4Object * SafeObjectPointer ( int32_t iNumber ) ;
2011-03-27 14:51:14 +00:00
int PostLoad ( bool fKeepInactive , C4ValueNumbers * ) ;
void Denumerate ( C4ValueNumbers * ) ;
2010-03-28 17:58:21 +00:00
void UpdateScriptPointers ( ) ; // update pointers to C4AulScript *
2011-03-05 16:36:16 +00:00
C4Value GRBroadcast ( const char * szFunction , C4AulParSet * pPars , bool fPassError , bool fRejectTest ) ; // call function in all goals/rules/environment objects
2010-03-28 17:58:21 +00:00
void UpdatePos ( C4Object * pObj ) ;
void UpdatePosResort ( C4Object * pObj ) ;
void FixObjectOrder ( ) ; // Called after loading: Resort any objects that are out of order
void ResortUnsorted ( ) ; // resort any objects with unsorted-flag set into lists
void DeleteObjects ( bool fDeleteInactive ) ; // delete all objects and links
bool ValidateOwners ( ) ;
bool AssignInfo ( ) ;
2015-01-02 00:06:00 +00:00
void AssignLightRange ( ) ;
2010-03-28 17:58:21 +00:00
void SyncClearance ( ) ;
void ResetAudibility ( ) ;
2013-12-17 16:16:11 +00:00
void OnSynchronized ( ) ;
2010-03-28 17:58:21 +00:00
void SetOCF ( ) ;
2013-08-10 20:31:33 +00:00
uint32_t GetNextMarker ( ) ; // Get a new marker. If all markers are exceeded (LastUsedMarker is 0xffffffff), restart marker at 1 and reset all object markers to zero.
2010-03-28 17:58:21 +00:00
} ;
2009-05-08 13:28:41 +00:00
2009-06-15 21:47:26 +00:00
extern C4GameObjects Objects ;
2009-05-08 13:28:41 +00:00
# endif