Entities are now constructable
Added utility function to display error window Added textures Added font Added a way to choose resources location
This commit is contained in:
parent
46d26b6e61
commit
3666b9e7e9
17 changed files with 155 additions and 39 deletions
|
@ -14,7 +14,7 @@
|
|||
enum class EntityType
|
||||
{
|
||||
Citizen,
|
||||
Player,
|
||||
Significant,
|
||||
House,
|
||||
Car,
|
||||
};
|
||||
|
@ -40,10 +40,9 @@ class Entity
|
|||
{
|
||||
public:
|
||||
/// 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);
|
||||
Entity(int x, int y, EntityType type, sf::Texture* texture, int width = 1, int height = 1);
|
||||
explicit Entity(const pugi::xml_node& entityNode, sf::Texture* texture);
|
||||
|
||||
void render(sf::RenderWindow& renderWindow) const;
|
||||
void move();
|
||||
void update();
|
||||
|
||||
|
@ -54,6 +53,8 @@ public:
|
|||
private:
|
||||
static const std::map<std::string,EntityType> entityTypeLookup;
|
||||
|
||||
EntityType type;
|
||||
|
||||
// As it contains position, size and orientation, we do not need anything more
|
||||
sf::RectangleShape shape;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue