38 lines
803 B
C++
38 lines
803 B
C++
#include "towers.h"
|
|
|
|
towers::towers(games *parent)
|
|
{
|
|
game = parent;
|
|
}
|
|
|
|
|
|
void towers::drawcell(QPoint pnt)
|
|
{
|
|
QPainter painter(game->background);
|
|
QPen pen(QColor(0,0,0));
|
|
QBrush brush(QColor(0,0,0),Qt::SolidPattern);
|
|
painter.setPen(pen);
|
|
painter.setBrush(brush);
|
|
painter.drawRect(pnt.x()*game->cellsize+1,pnt.y()*game->cellsize+1,game->cellsize - 2, game->cellsize - 2);
|
|
painter.end();
|
|
}
|
|
|
|
|
|
void towers::clearcell(QPoint pnt)
|
|
{
|
|
QPainter painter(game->background);
|
|
QPen pen(QColor::fromRgb(qRgb(150,150,150)));
|
|
QBrush brush(QColor(150,150,150),Qt::SolidPattern);
|
|
painter.setPen(pen);
|
|
painter.setBrush(brush);
|
|
painter.drawRect(pnt.x()*game->cellsize+1,pnt.y()*game->cellsize+1,game->cellsize - 2, game->cellsize - 2);
|
|
painter.end();
|
|
}
|
|
|
|
/*
|
|
void towers::AddTower(QPoint point, int type)
|
|
{
|
|
|
|
}
|
|
*/
|