asteroids-cs165/include/flyingObject.h

29 lines
730 B
C
Raw Permalink Normal View History

2020-06-30 22:04:55 -04:00
#ifndef flyingObject_h
#define flyingObject_h
#include "point.h"
#include "velocity.h"
#include "uiDraw.h"
class FlyingObject
{
protected:
Point point;
2020-06-30 22:16:33 -04:00
Velocity velocity;
2020-06-30 22:04:55 -04:00
bool alive;
public:
FlyingObject() : point( Point() ) , velocity( Velocity() ) , alive( true ) {}
Point getPoint() const { return this->point; }
void setPoint( const Point &point ) { this->point = point; }
Velocity getVelocity() const { return this->velocity; }
void setVelocity( const Velocity &velocity) { this->velocity = velocity; }
bool isAlive() { return this->alive; }
void kill() { alive = false; };
virtual void draw() { drawDot( point ); };
virtual void advance();
};
#endif /* flyingObject_h */