summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/components.cpp1
-rw-r--r--src/components.h10
-rw-r--r--src/entity.h10
-rw-r--r--src/entityfactory.cpp1
-rw-r--r--src/entityfactory.h7
-rw-r--r--src/game.cpp1
-rw-r--r--src/game.h9
-rw-r--r--src/map.cpp1
8 files changed, 23 insertions, 17 deletions
diff --git a/src/components.cpp b/src/components.cpp index ba4fe72..e41e2cd 100644 --- a/src/components.cpp +++ b/src/components.cpp
@@ -1,6 +1,7 @@
1#include "components.h" 1#include "components.h"
2#include "game.h" 2#include "game.h"
3#include "muxer.h" 3#include "muxer.h"
4#include "map.h"
4 5
5// User movement component 6// User movement component
6 7
diff --git a/src/components.h b/src/components.h index 3d80d1a..2ec19ff 100644 --- a/src/components.h +++ b/src/components.h
@@ -1,11 +1,13 @@
1#ifndef COMPONENTS_H 1#ifndef COMPONENTS_H
2#define COMPONENTS_H 2#define COMPONENTS_H
3 3
4#include "entity.h"
5#include <utility> 4#include <utility>
6#include <list> 5#include <list>
7#include "map.h" 6#include "renderer.h"
8#include <memory> 7#include "entity.h"
8#include "game.h"
9
10class Map;
9 11
10class UserMovementComponent : public Component { 12class UserMovementComponent : public Component {
11 public: 13 public:
@@ -33,7 +35,7 @@ class PlayerSpriteComponent : public Component {
33 void receive(Game& game, Entity& entity, const Message& msg); 35 void receive(Game& game, Entity& entity, const Message& msg);
34 36
35 private: 37 private:
36 Texture sprite{"../res/Starla.png"}; 38 Texture sprite {"../res/Starla.png"};
37 int animFrame = 0; 39 int animFrame = 0;
38 bool facingLeft = false; 40 bool facingLeft = false;
39 bool isMoving = false; 41 bool isMoving = false;
diff --git a/src/entity.h b/src/entity.h index 44ce973..26febfb 100644 --- a/src/entity.h +++ b/src/entity.h
@@ -1,13 +1,13 @@
1#ifndef ENTITY_H 1#ifndef ENTITY_H
2#define ENTITY_H 2#define ENTITY_H
3 3
4class Entity;
5class Component;
6
7#include <list> 4#include <list>
8#include "renderer.h" 5#include "renderer.h"
9#include "game.h" 6
10#include "map.h" 7class Game;
8class Map;
9class Entity;
10class Component;
11 11
12class Message { 12class Message {
13 public: 13 public:
diff --git a/src/entityfactory.cpp b/src/entityfactory.cpp index acf9b8e..3fcb9ed 100644 --- a/src/entityfactory.cpp +++ b/src/entityfactory.cpp
@@ -3,6 +3,7 @@
3#include "components.h" 3#include "components.h"
4#include "muxer.h" 4#include "muxer.h"
5#include <cstdio> 5#include <cstdio>
6#include <map>
6 7
7struct EntityData { 8struct EntityData {
8 char* sprite; 9 char* sprite;
diff --git a/src/entityfactory.h b/src/entityfactory.h index a35b5f7..7b8f399 100644 --- a/src/entityfactory.h +++ b/src/entityfactory.h
@@ -1,11 +1,10 @@
1#ifndef ENTITYFACTORY_H 1#ifndef ENTITYFACTORY_H
2#define ENTITYFACTORY_H 2#define ENTITYFACTORY_H
3 3
4#include "entity.h"
5#include <memory>
6#include <string> 4#include <string>
7#include <map> 5
8#include "map.h" 6class Entity;
7class Map;
9 8
10class EntityFactory { 9class EntityFactory {
11 public: 10 public:
diff --git a/src/game.cpp b/src/game.cpp index 1ff3f4f..68c0a13 100644 --- a/src/game.cpp +++ b/src/game.cpp
@@ -3,6 +3,7 @@
3#include "components.h" 3#include "components.h"
4#include "muxer.h" 4#include "muxer.h"
5#include "entityfactory.h" 5#include "entityfactory.h"
6#include "map.h"
6 7
7Game::Game() 8Game::Game()
8{ 9{
diff --git a/src/game.h b/src/game.h index ab8b906..065aca8 100644 --- a/src/game.h +++ b/src/game.h
@@ -1,12 +1,13 @@
1#ifndef GAME_H 1#ifndef GAME_H
2#define GAME_H 2#define GAME_H
3 3
4class Game;
5
6#include "map.h"
7#include <memory> 4#include <memory>
8#include "entity.h"
9#include <functional> 5#include <functional>
6#include "renderer.h"
7#include <list>
8
9class Entity;
10class Map;
10 11
11const int TILE_WIDTH = 8; 12const int TILE_WIDTH = 8;
12const int TILE_HEIGHT = 8; 13const int TILE_HEIGHT = 8;
diff --git a/src/map.cpp b/src/map.cpp index 8c1c6f0..2be5071 100644 --- a/src/map.cpp +++ b/src/map.cpp
@@ -5,6 +5,7 @@
5#include <libxml/parser.h> 5#include <libxml/parser.h>
6#include <map> 6#include <map>
7#include "entityfactory.h" 7#include "entityfactory.h"
8#include "entity.h"
8 9
9static std::map<std::string, Map> maps; 10static std::map<std::string, Map> maps;
10 11