This repository has been archived on 2019-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
dungeon-gunner/source/abstract/Rectangle.h
Felix Ableitner aa6df65e97 Changed sprites to always render as rectangle.
Also created Rectangle/Circle subclasses for sprite to handle
collision detection and moved collision detection from World to
CollisionModel (static methods).
2013-05-08 00:42:26 +02:00

29 lines
627 B
C++

/*
* Rectangle.h
*
* Created on: 04.05.2013
* Author: Felix
*/
#ifndef DG_RECTANGLE_H_
#define DG_RECTANGLE_H_
#include "CollisionModel.h"
#include "Sprite.h"
class Yaml;
/**
* Shape that uses an axis aligned Rectangle as a collision model.
*/
class Rectangle : public CollisionModel, public Sprite {
public:
explicit Rectangle(const sf::Vector2f& position, Category category,
unsigned short mask, const Yaml& config,
const sf::Vector2f& direction = sf::Vector2f(0, 0));
virtual ~Rectangle() = default;
bool testCollision(std::shared_ptr<Sprite> other, int elapsed);
};
#endif /* DG_RECTANGLE_H_ */