sonus::World2D< T > Class Template Reference

#include <World2D.h>

List of all members.

Public Member Functions

 World2D ()
 World2D (int length)
 ~World2D ()
bool setBorder (Body2D< T > *b)
Body2D< T > * getBorder ()
int pushObstacle (Body2D< T > *b)
Body2D< T > * popObstacle ()
Body2D< T > * getObstacleAt (int index)
void clear ()
int getIndexOf (Body2D< T > *b)
int getLength ()
int getSize ()


Detailed Description

template<class T>
class sonus::World2D< T >

sonus::World2D

A world made of Body2D<T> objects. The border is surrounding object, while obstacles are objects within these borders.

filename: World2D.h

Date:
2008/04/27 18:09
Author:
Alexander Lawrence
Version:
1.0

Constructor & Destructor Documentation

template<class T>
sonus::World2D< T >::World2D (  )  [inline]

Constructor

template<class T>
sonus::World2D< T >::World2D ( int  length  )  [inline]

Constructor with length

Parameters:
length the max. number of bodies

template<class T>
sonus::World2D< T >::~World2D (  )  [inline]

Destructor


Member Function Documentation

template<class T>
bool sonus::World2D< T >::setBorder ( Body2D< T > *  b  )  [inline]

Setter for the border

Parameters:
b the border of the world

template<class T>
Body2D< T > * sonus::World2D< T >::getBorder (  )  [inline]

Getter for the border

Returns:
the border Body2D

template<class T>
int sonus::World2D< T >::pushObstacle ( Body2D< T > *  b  )  [inline]

Pushes one element onto the stack

Parameters:
b body to be pushed
Returns:
current size of the stack or -1 if stack is full

template<class T>
Body2D< T > * sonus::World2D< T >::popObstacle (  )  [inline]

Pops one element off the stack

Returns:
the popped Body2D

template<class T>
Body2D< T > * sonus::World2D< T >::getObstacleAt ( int  index  )  [inline]

Gets one element at index from stack (element is not popped off the stack)

Parameters:
index the index of requested element
Returns:
the requested Body2D (not popped off) or null

template<class T>
void sonus::World2D< T >::clear (  )  [inline]

Clears the stack

template<class T>
int sonus::World2D< T >::getIndexOf ( Body2D< T > *  b  )  [inline]

Gets the index of one element

Parameters:
b the body
Returns:
the index of the body or -1

template<class T>
int sonus::World2D< T >::getLength (  )  [inline]

Get the maximum length of the container (not the size)

Returns:
the length

template<class T>
int sonus::World2D< T >::getSize (  )  [inline]

Get the current size of the container

Returns:
the size


The documentation for this class was generated from the following file:
Generated on Tue Aug 26 12:26:54 2008 for sonus by  doxygen 1.5.4