1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
/****************************************************************
**
** Attal : Lords of Doom
**
** genericFightCell.h
** generic class for managing (not graphical) fightCells
**
** Version : $Id: genericFightCell.h,v 1.4 2008/04/14 23:06:14 lusum Exp $
**
** Author(s) : Pascal Audoux - Cyrille Verrier
**
** Date : 02/08/2000
**
** Licence :
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2, or (at your option)
** any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
****************************************************************/
#ifndef GENERICFIGHTCELL_H
#define GENERICFIGHTCELL_H
// generic include files
// include files for QT
// application specific includes
#include "libCommon/attalCommon.h"
class GenericFightUnit;
/* ------------------------------
* GenericFightCell
* ------------------------------ */
/** generic class for managing (not graphical) fightCells */
class GenericFightCell
{
public:
/** Constructor */
GenericFightCell( int row, int col );
/** Destructor */
virtual ~GenericFightCell();
/** Set type of the fight cell */
void setType( int typ ) {
_type = typ;
_coeff = (typ == AttalCommon::OBSTACLE ? -1:1);
}
/** return type of the fight cell */
inline int getType() { return _type; }
void setAccess( AttalCommon::FightCellAccess typ ) { _access = typ; }
AttalCommon::FightCellAccess getAccess() { return _access; }
int getDist() { return _dist; }
void setDist( int dist ) { _dist = dist; }
/** Return row */
int getRow() { return _row; }
/** Return col */
int getCol()
{ return _col; }
void setRow( int row ) { _row=row; }
void setCol( int col ) { _col=col; }
/** Tell which unit is on it */
void setUnit( GenericFightUnit * unit ) { _unit = unit; }
/** Return the unit on the cell */
GenericFightUnit * getUnit() { return _unit; }
/** Tell which unit is on it */
void setHeadUnit( GenericFightUnit * unit ) { _headUnit = unit; }
/** Return the unit on the cell */
GenericFightUnit * getHeadUnit() { return _headUnit; }
protected:
int _coeff;
int _type;
int _dist;
int _row, _col;
GenericFightUnit * _unit;
GenericFightUnit * _headUnit;
AttalCommon::FightCellAccess _access;
};
#endif // GENERICFIGHTCELL_H
|