diff options
Diffstat (limited to 'src/object.cpp')
-rw-r--r-- | src/object.cpp | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/src/object.cpp b/src/object.cpp new file mode 100644 index 0000000..5f1fac7 --- /dev/null +++ b/src/object.cpp @@ -0,0 +1,120 @@ +#include "object.h" +#include "point.h" +#include "velocity.h" +#include "acceleration.h" + +Object :: Object() { + setAngle(0.0f); + setWidth(0); + setHeight(0); + setPoint(Point()); + setVelocity(Velocity()); + setAcceleration(Acceleration()); + setAlive(true); +} + +Object :: Object(const Point &point) { + setAngle(0.0f); + setWidth(0); + setHeight(0); + setPoint(point); + setVelocity(Velocity()); + setAcceleration(Acceleration()); + setAlive(true); +} + +Object :: Object(const Point &point, const Velocity &velocity) { + setAngle(0.0f); + setWidth(0); + setHeight(0); + setPoint(point); + setVelocity(velocity); + setAcceleration(Acceleration()); + setAlive(true); +} +Object :: Object(const Point &point, const Velocity &velocity, const Acceleration &acceleration) { + setAngle(0.0f); + setWidth(0); + setHeight(0); + setPoint(point); + setVelocity(velocity); + setAcceleration(acceleration); + setAlive(true); +} + +void Object :: setAngle(const float angle) { + this->angle = angle; +} + +void Object :: setWidth(const int width) { + this->width = width; +} + +void Object :: setHeight(const int height) { + this->height = height; +} + +void Object :: setPoint(const Point &point) { + this->point = point; +} + +void Object :: setVelocity(const Velocity &velocity) { + this->velocity = velocity; +} + +void Object :: setAcceleration(const Acceleration &acceleration) { + this->acceleration = acceleration; +} + +void Object :: setAlive(const bool alive) { + this->alive = alive; +} + +void Object :: setTexture(const sf::Texture &texture) { + this->texture = texture; +} + +void Object :: setSprite(const sf::Sprite &sprite) { + this->sprite = sprite; +} + +float Object :: getAngle() { + return this->angle; +} + +int Object :: getWidth() { + return this->width; +} + +int Object :: getHeight() { + return this->height; +} + +Point Object :: getPoint() { + return this->point; +} + +Velocity Object :: getVelocity() { + return this->velocity; +} + +Acceleration Object :: getAcceleration() { + return this->acceleration; +} + +bool Object :: getAlive() { + return this->alive; +} + +sf::Texture Object :: getTexture() { + return this->texture; +} + +sf::Sprite Object :: getSprite() { + return this->sprite; +} + +void Object :: kill() { + setAlive(false); +} + |