summaryrefslogtreecommitdiffstats
path: root/labb4/Robot.h
blob: 74ad592fa8d7840651103c232716a382b962c251 (plain) (blame)
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
/**
 * Copyright (C) David Wolfe, 1999.  All rights reserved.
 * Ported to Qt and adapted for TDDD86, 2015.
 */

#ifndef ROBOT_H
#define ROBOT_H

#include "Unit.h"
#include <QGraphicsScene>

class Robot : public Unit {
public:
    Robot();
    virtual ~Robot() = default;
    virtual void draw(QGraphicsScene* scene) const;

    /*
     * Take one step closer to u.
     */
    virtual void moveTowards(const Unit& u) override;

    /*
     * All robots are alive.
     */
    virtual bool alive() const { return true; };

    /*
     * Polymorphic clone.
     */
    virtual Robot *clone() const;
};

#endif // ROBOT_H