Files
robots/src/Hero.cpp
2024-09-11 17:18:54 +02:00

24 lines
571 B
C++
Executable File

/**
* Copyright (C) David Wolfe, 1999. All rights reserved.
* Ported to Qt and adapted for TDDD86, 2015.
*/
#include "Hero.h"
#include "constants.h"
void Hero::draw(QGraphicsScene *scene) const {
Point corner = asPoint();
scene->addRect(QRectF(corner.x * UNIT_WIDTH, corner.y * UNIT_HEIGHT,
UNIT_WIDTH, UNIT_HEIGHT), Qt::NoPen, QBrush(HERO_COLOR));
}
Unit *Hero::clone() const {
return new Hero(*this);
}
bool Hero::isAlive() const { return true; }
bool Hero::isToBeJunked() const { return false; }
void Hero::doCrash() {}