Started object construction and parsing

Simplified some structures
Missing : Entity construction
This commit is contained in:
trotFunky 2019-06-07 02:59:27 +02:00
parent 67435debe6
commit 46d26b6e61
10 changed files with 146 additions and 5 deletions

View file

@ -6,6 +6,9 @@
#define SRC_ENTITY_H
#include <SFML/Graphics.hpp>
#include <pugixml.hpp>
#include "Utils.h"
enum class EntityType
@ -36,15 +39,21 @@ enum class Orientation
class Entity
{
public:
Entity();
/// x,y, width and height are in grid coordinates
Entity(int x, int y, EntityType type, int width = 1, int height = 1);
Entity(const pugi::xml_node& entityNode);
void render(sf::RenderWindow& renderWindow) const;
void move();
void update();
const sf::RectangleShape& getShape() const;
/// Position of the target of the current action on the map
sf::Vector2i target;
private:
static const std::map<std::string,EntityType> entityTypeLookup;
// As it contains position, size and orientation, we do not need anything more
sf::RectangleShape shape;