|
duncan
Mom and Dad were wrong!
|
#include <charlist.h>
Public Types | |
|
typedef std::pair< T *, std::pair< double, double > > | node_t |
| typedef tree_t::const_iterator | const_iterator |
Public Member Functions | |
| CharList () | |
| void | insert (T *c) |
| void | erase (T *c) |
| void | optimise () |
| const_iterator | begin () |
| const_iterator | end () |
| void | square (double rc, double cc, double r, std::vector< node_t > &v) const |
| void | square (T *c, double r, std::vector< node_t > &v) const |
| T * | nearest (double r, double c) |
| void | move (T *e, double r, double c) |
Static Public Member Functions | |
| static double | acc (node_t c, size_t k) |
Maintain a list of characters in such a way that all characters inside a given rectangle can be found quickly.
see LICENSE
| server::CharList< T >::CharList | ( | ) | [inline] |
This is a constructor. It constructs.
| static double server::CharList< T >::acc | ( | node_t | c, |
| size_t | k | ||
| ) | [inline, static] |
Get a particular coordinate of a character's position. c pointer to character
| k | coordinate index (0 or 1) |
| const_iterator server::CharList< T >::begin | ( | ) | [inline] |
Get an iterator pointing to the first element of the tree.
| const_iterator server::CharList< T >::end | ( | ) | [inline] |
Get an iterator pointing to the last element of the tree.
| void server::CharList< T >::erase | ( | T * | c | ) | [inline] |
Remove an element from the list.
| c | pointer to element |
| void server::CharList< T >::insert | ( | T * | c | ) | [inline] |
Add an element to the tree.
| c | pointer to element |
| void server::CharList< T >::move | ( | T * | e, |
| double | r, | ||
| double | c | ||
| ) | [inline] |
Updates the position of the specified element in the list.
| e | pointer to element |
| r | new row |
| c | new col |
| T* server::CharList< T >::nearest | ( | double | r, |
| double | c | ||
| ) | [inline] |
Get the character closest to a certain point.
| r | row of point |
| c | column of point |
| void server::CharList< T >::optimise | ( | ) | [inline] |
Rebuilds the tree.
| void server::CharList< T >::square | ( | double | rc, |
| double | cc, | ||
| double | r, | ||
| std::vector< node_t > & | v | ||
| ) | const [inline] |
Get all characters inside a square.
| rc | row of center |
| cc | col of center |
| r | `radius' of square |
| v | vector to fill with characters |
| void server::CharList< T >::square | ( | T * | c, |
| double | r, | ||
| std::vector< node_t > & | v | ||
| ) | const [inline] |
Get all characters inside a square centered at a certain character.
| c | center character |
| r | `radius' of square |
| v | vector to fill with characters |
1.7.4