Position Class Reference
[Miscellaneous Tools]

Handy class to describe a position.

It is just a point, with a set of methods that makes it useful. More...

#include <Position.hh>

Inheritance diagram for Position:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Position (int row, int col)
 Position (const Point &pos)
int getRow () const
int getCol () const
void setRow (int row)
void setCol (int col)
int getX () const
int getY () const
void setX (int x)
void setY (int y)
bool isNear (const Position &from, int dist=1) const
 Check if another point is in the neighbourhood.
float distance (const Position &to) const
 Return the distance between the two point.
Positionoperator+= (const Position &rhs)
int getQuantity ()
void setQuantity (int qty)
const char * getTitle ()
void setTitle (const char *title)
long getCost ()
void setCost (long cost)
int getMovementAllowance ()
void setMovementAllowance (int ma)
int getStrength ()
void setStrength (int st)
int getAgility ()
void setAgility (int ag)
int getArmourValue ()
void setArmourValue (int av)
std::vector< const char * > getSkills ()
void addSkill (const char *skill)
const char * getNormalSkills ()
void setNormalSkills (const char *normalSkills)
const char * getDoubleSkills ()
void setDoubleSkills (const char *doubleSkills)
const char * getDisplay ()
void setDisplay (const char *display)

Public Attributes

int row
 Row position.
int col
 Column position.

Friends

bool operator== (const Position &lhs, const Position &rhs)
bool operator!= (const Position &lhs, const Position &rhs)
Position operator+ (const Position &lhs, const Position &rhs)
Position operator- (const Position &lhs, const Position &rhs)
Position operator * (int factor, const Position &rhs)
std::ostream & operator<< (std::ostream &os, const Position &p)

Detailed Description

Handy class to describe a position.

It is just a point, with a set of methods that makes it useful.

Author:
victor
Date:
10/02/2006


Member Function Documentation

bool Position::isNear ( const Position from,
int  dist = 1 
) const [inline]

Check if another point is in the neighbourhood.

The distance is calculated using the absolute norm.

Parameters:
from The other point to check for.
dist Distance allowed, diagonal authorized.


The documentation for this class was generated from the following files:
Generated on Sat Jun 23 16:12:42 2007 for Stechec/TBT by  doxygen 1.4.7