3rd Eye Scene C#
3rd Eye Scene C# documentation
Tes::Handlers::TransientShapeCache Class Reference

A cache for transient shape objects. More...

List of all members.

Public Member Functions

 TransientShapeCache ()
 Create a new cache starting with the default number of objects.
 TransientShapeCache (int initialCapacity)
 Create a new cache starting with the given initial number of objects.
void Add (GameObject obj)
 Add a transient object to the cache.
GameObject Fetch ()
 Fetch and reuse an existing transient object from the cache.
void Reset ()
 Deactivate all objects.
void Reset (bool deleteObjects)
 Reset the cache to have no active objects, optinally deleting the objects.

Public Attributes

const int DefaultCacheSize = 512
 Default number of objects to start with.

Properties

int Count [get]
 The number of cached objects.
GameObject LastObject [get]
 Access the activated transient object.
IEnumerable< GameObject > Objects [get]
 Iterate the active objects (active only).

Detailed Description

A cache for transient shape objects.

The intended usage is to create shape objects as required, then register them with the cache. The cache ensures they are remove from the scene when Reset() is called. However, the objects are not destroyed and may be re-used by requesting an existing object calling Fetch(). This fails if no cached objects are available, in which case a new object should be registered using Add(GameObject).


Constructor & Destructor Documentation

Tes::Handlers::TransientShapeCache::TransientShapeCache ( int  initialCapacity) [inline]

Create a new cache starting with the given initial number of objects.

Parameters:
initialCapacityThe initial number of objects.

Member Function Documentation

void Tes::Handlers::TransientShapeCache::Add ( GameObject  obj) [inline]

Add a transient object to the cache.

Parameters:
objThe new transient object.
GameObject Tes::Handlers::TransientShapeCache::Fetch ( ) [inline]

Fetch and reuse an existing transient object from the cache.

Returns:
A new transient object
void Tes::Handlers::TransientShapeCache::Reset ( bool  deleteObjects) [inline]

Reset the cache to have no active objects, optinally deleting the objects.

Parameters:
deleteObjectsTrue to delete the objects.

Property Documentation

int Tes::Handlers::TransientShapeCache::Count [get]

The number of cached objects.

Fewer objects may be active.

GameObject Tes::Handlers::TransientShapeCache::LastObject [get]

Access the activated transient object.

Returns:

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations Properties Events