diff options
Diffstat (limited to 'src/UFO.cpp')
-rw-r--r-- | src/UFO.cpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/UFO.cpp b/src/UFO.cpp new file mode 100644 index 0000000..3739d21 --- /dev/null +++ b/src/UFO.cpp @@ -0,0 +1,65 @@ +#include "UFO.h" +#include "point.h" +#include "velocity.h" +#include <iostream> +using namespace std; +// UFO Default constructor +UFO :: UFO() +{ + setAlive ( true ); +} + +// Get Ufo point +Point UFO :: getPoint() const +{ + return this->point; +} + +// Get UFO velocity +Velocity UFO:: getVelocity() const +{ + return this->velocity; +} + +// Get UFO alive +bool UFO :: isAlive() const +{ + return this->alive; +} + +// Set UFO point +void UFO :: setPoint( const Point &point ) +{ + this->point = point; +} + +// Set UFO velocity +void UFO :: setVelocity( const Velocity &velocity) +{ + this->velocity = velocity; +} + +// Set UFO velocity with dy & dx +void UFO :: setVelocity ( float dx , float dy ) +{ + velocity = Velocity ( dx , dy ); +} + +// Set UFO alive +void UFO :: setAlive ( const bool alive ) +{ + this->alive = alive; +} + +// Advance UFO +void UFO :: advance() +{ + setPoint ( this->velocity.updatePoint ( this->point ) ); +} + + +// Kill UFO +void UFO :: kill() +{ + this->alive = false; +} |