#include <World2D.h>
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 () |
A world made of Body2D<T> objects. The border is surrounding object, while obstacles are objects within these borders.
filename: World2D.h
| sonus::World2D< T >::World2D | ( | ) | [inline] |
Constructor
| sonus::World2D< T >::World2D | ( | int | length | ) | [inline] |
Constructor with length
| length | the max. number of bodies |
| sonus::World2D< T >::~World2D | ( | ) | [inline] |
Destructor
| bool sonus::World2D< T >::setBorder | ( | Body2D< T > * | b | ) | [inline] |
Setter for the border
| b | the border of the world |
| Body2D< T > * sonus::World2D< T >::getBorder | ( | ) | [inline] |
| int sonus::World2D< T >::pushObstacle | ( | Body2D< T > * | b | ) | [inline] |
Pushes one element onto the stack
| b | body to be pushed |
| Body2D< T > * sonus::World2D< T >::popObstacle | ( | ) | [inline] |
| Body2D< T > * sonus::World2D< T >::getObstacleAt | ( | int | index | ) | [inline] |
Gets one element at index from stack (element is not popped off the stack)
| index | the index of requested element |
| void sonus::World2D< T >::clear | ( | ) | [inline] |
Clears the stack
| int sonus::World2D< T >::getIndexOf | ( | Body2D< T > * | b | ) | [inline] |
Gets the index of one element
| b | the body |
| int sonus::World2D< T >::getLength | ( | ) | [inline] |
Get the maximum length of the container (not the size)
| int sonus::World2D< T >::getSize | ( | ) | [inline] |
Get the current size of the container
1.5.4