Module svs_core.utilities.idbroker
Module for handling unique identifier tags within a project. The
idbroker is implemented as a singleton.
The idbroker is based on an 'object manager' example by Matthew Walker
in Massive Multiplayer Game Development, Charles River Media,
2004.
Author: Simon Yuill
Contact: simon@lipparosa.org
Copyright: 2005 Simon Yuill
License: GNU GPL version 2 or any later version
| Function Summary |
| |
__ModuleInit__()
Set up module-level attributes |
| object
|
getObjectFromID(id)
Returns the object with the requested id, or None if it doesn't
exist. |
| list
|
getObjectsOfType(type)
Returns a list of objects of specified class type, or None if it
doesn't exist. |
| |
newObject(obj)
Creates unique id for object and adds it to lists. |
| integer
|
nextId()
Generate a new object id. |
| integer
|
removeObject(obj)
Removes object from lists. |
__ModuleInit__()
Set up module-level attributes
-
|
getObjectFromID(id)
Returns the object with the requested id, or None if it doesn't
exist.
-
- Parameters:
id -
id for requested object
(type=integer)
- Returns:
-
requested object
(type=object)
|
getObjectsOfType(type)
Returns a list of objects of specified class type, or None if it
doesn't exist.
-
- Parameters:
type -
class object type for requested list
(type=classobj)
- Returns:
-
list of requested object types
(type=list)
|
newObject(obj)
Creates unique id for object and adds it to lists.
-
- Parameters:
obj -
object to be given id and added to lists
(type=object)
|
nextId()
Generate a new object id.
-
- Returns:
-
new unique id
(type=integer)
|
removeObject(obj)
Removes object from lists.
-
- Parameters:
obj -
object to be removed
(type=object)
- Returns:
-
id of removed object
(type=integer)
|