diff --git a/game/src/BulletManager.cpp b/game/src/BulletManager.cpp index 2db04c68aa6034626afaf78b9c27ce26ff8755a7..749233d5ddae38ff07dd4e3a32b9f586881e8b1c 100644 --- a/game/src/BulletManager.cpp +++ b/game/src/BulletManager.cpp @@ -3,6 +3,9 @@ #include <algorithm> #include <box2d/b2_math.h> +namespace game +{ + BulletManager::BulletManager(b2World *world, TilesheetManager &tilesheetManager, lvl::Level &level) : m_world(world), m_tilesheetManager(tilesheetManager), m_level(level) { @@ -110,4 +113,6 @@ void BulletManager::cleanup() } m_player_projectiles.clear(); m_enemy_projectiles.clear(); +} + } \ No newline at end of file diff --git a/game/src/BulletManager.hpp b/game/src/BulletManager.hpp index 77e10d8e14da0a705bb01735fa033efc0679cabc..440154d28edeef5bbdb06fc733fdec59f88e3e0a 100644 --- a/game/src/BulletManager.hpp +++ b/game/src/BulletManager.hpp @@ -7,6 +7,9 @@ #include <box2d/box2d.h> #include <vector> +namespace game +{ + /** * @class BulletManager * @brief A class responsible for managing projectiles in the game. @@ -93,3 +96,5 @@ class BulletManager */ void cleanup(); }; + +} \ No newline at end of file diff --git a/game/src/BulletObject.cpp b/game/src/BulletObject.cpp index a1192c71bd82398100e9db45934b6b216f4fd3b9..9401dd408fe81f709c0561ba08f0f7fbbef43598 100644 --- a/game/src/BulletObject.cpp +++ b/game/src/BulletObject.cpp @@ -1,5 +1,8 @@ #include "BulletObject.hpp" +namespace game +{ + BulletObject::BulletObject(b2World *world, const b2Vec2 &position, const b2Vec2 &size, float density, float scale, float friction, const std::vector<int> &tileIDs) : DynamicObject(world, position, size, density, scale, friction, tileIDs, true) @@ -15,4 +18,6 @@ void BulletObject::ApplyLinearImpulse(const b2Vec2 &impulse) b2Body *BulletObject::getBody() { return m_body; +} + } \ No newline at end of file diff --git a/game/src/BulletObject.hpp b/game/src/BulletObject.hpp index 65b0900e8b204ec8ea050d25af2106721f4dbf22..a8ea56f6af222e357e3d11f57b18e23232eceec8 100644 --- a/game/src/BulletObject.hpp +++ b/game/src/BulletObject.hpp @@ -2,6 +2,9 @@ #include "DynamicObject.hpp" #include <box2d/box2d.h> +namespace game +{ + /** * @class BulletObject * @brief A class representing a bullet in a physics-based game world. @@ -51,3 +54,5 @@ class BulletObject : public DynamicObject */ b2Body *getBody(); }; + +} \ No newline at end of file diff --git a/game/src/Camera.cpp b/game/src/Camera.cpp index 95ef7cfc2c3e0328d295bd7b28dfc7d312d28231..cfb96f2e470a669f5675fd812c25055528fb2dcb 100644 --- a/game/src/Camera.cpp +++ b/game/src/Camera.cpp @@ -1,5 +1,8 @@ #include "Camera.hpp" +namespace game +{ + Camera::Camera(int viewportWidth, int viewportHeight, int levelWidth, int levelHeight) : m_X(0), m_Y(0), m_viewportWidth(viewportWidth), m_viewportHeight(viewportHeight), m_LevelWidth(levelWidth), m_LevelHeight(levelHeight) @@ -53,4 +56,6 @@ void Camera::updateContext(int x, int y, int viewportWidth, int viewportHeight, m_viewportHeight = viewportHeight; m_LevelWidth = levelWidth; m_LevelHeight = levelHeight; +} + } \ No newline at end of file diff --git a/game/src/Camera.hpp b/game/src/Camera.hpp index a3557f47706b4dd2095dffcfe220d62312174d24..0dec6039d1080bc0e64bbab63ceed90a3e87c4ef 100644 --- a/game/src/Camera.hpp +++ b/game/src/Camera.hpp @@ -1,6 +1,9 @@ #pragma once #include <algorithm> +namespace game +{ + /** * @brief Smoothing factor for camera movement. */ @@ -89,3 +92,5 @@ class Camera int m_LevelWidth; ///< The width of the level. int m_LevelHeight; ///< The height of the level. }; + +} \ No newline at end of file diff --git a/game/src/ContactListener.cpp b/game/src/ContactListener.cpp index d9076b410b66bb0a462c070deae1105135510e07..02919e5afd026813c3dbebb05f8c1acad00f12f4 100644 --- a/game/src/ContactListener.cpp +++ b/game/src/ContactListener.cpp @@ -1,6 +1,9 @@ #include "ContactListener.hpp" #include <iostream> +namespace game +{ + ContactListener::ContactListener() { } @@ -123,4 +126,6 @@ bool ContactListener::door_entered() bool state= m_door_entered; m_door_entered = false; return state; +} + } \ No newline at end of file diff --git a/game/src/ContactListener.hpp b/game/src/ContactListener.hpp index 9f2cb8285e41489c202d46e8f7b1ccfd61bb11a4..0e2e42fa338b072b4a0fb9c3bf4f274a5e0320f1 100644 --- a/game/src/ContactListener.hpp +++ b/game/src/ContactListener.hpp @@ -3,6 +3,9 @@ #include <box2d/box2d.h> #include <vector> +namespace game +{ + /** * @class ContactListener * @brief A class that handles collision events in the Box2D physics world. @@ -84,3 +87,5 @@ class ContactListener : public b2ContactListener bool m_door_entered; }; + +} \ No newline at end of file diff --git a/game/src/DynamicObject.cpp b/game/src/DynamicObject.cpp index 4ee347d49d02626424b7f88ba2ba71e37c4bba01..fa9955610cc61fa99fc19f28cc01dd8344abe6a5 100644 --- a/game/src/DynamicObject.cpp +++ b/game/src/DynamicObject.cpp @@ -1,8 +1,13 @@ #include "DynamicObject.hpp" +namespace game +{ + DynamicObject::DynamicObject(b2World *world, const b2Vec2 &position, const b2Vec2 &size, float density, float scale, float friction, const std::vector<int> &tileIDs, bool isBullet) : GameObject(world, position, size, density, scale, friction, tileIDs, isBullet, true) { m_body->SetLinearDamping(3.0f); +} + } \ No newline at end of file diff --git a/game/src/DynamicObject.hpp b/game/src/DynamicObject.hpp index 1ab60ba74144a862f38ecb168da028f6f31afb69..a8621b7ba2dc1b02575b708d44f5c5ea06e840f3 100644 --- a/game/src/DynamicObject.hpp +++ b/game/src/DynamicObject.hpp @@ -1,6 +1,9 @@ #pragma once #include "GameObject.hpp" +namespace game +{ + /** * @class DynamicObject * @brief A class representing a dynamic object in the Box2D physics world. @@ -30,3 +33,5 @@ class DynamicObject : public GameObject DynamicObject(b2World *world, const b2Vec2 &position, const b2Vec2 &size, float density, float scale, float friction, const std::vector<int> &tileIDs, bool isBullet); }; + +} \ No newline at end of file diff --git a/game/src/Enemy.cpp b/game/src/Enemy.cpp index cd6a88463307f8e07cdaea38f0de00a3df0ded78..87e8de504661c3fb5d2b8655f9e89e59dc36f71f 100644 --- a/game/src/Enemy.cpp +++ b/game/src/Enemy.cpp @@ -1,6 +1,9 @@ #include "Enemy.hpp" #include <box2d/b2_math.h> +namespace game +{ + Enemy::Enemy(b2World *world, const b2Vec2 &position, const b2Vec2 &size, float density, float scale, float friction, BulletManager &bulletmanager, const std::vector<int> &tileIDs, int health, int damage) : DynamicObject(world, position, size, density, scale, friction, tileIDs, false), m_lastFire(1000), m_fireRate(2), @@ -47,4 +50,6 @@ void Enemy::take_damage(int damage) b2Body *Enemy::getBody() { return m_body; +} + } \ No newline at end of file diff --git a/game/src/Enemy.hpp b/game/src/Enemy.hpp index c8d16893c44cbc4904ef20000fd47b7ca5b1af56..00104bb33f59b6c260fcd584f480ff22f2200e4c 100644 --- a/game/src/Enemy.hpp +++ b/game/src/Enemy.hpp @@ -2,6 +2,9 @@ #include "BulletManager.hpp" #include "DynamicObject.hpp" +namespace game +{ + /** * @class Enemy * @brief A class representing an enemy object in the game, with physics and rendering capabilities. @@ -68,3 +71,5 @@ class Enemy : public DynamicObject Uint32 m_fireDelay; /**< The delay between shots in milliseconds. */ Uint32 m_lastFire; /**< The timestamp of the last shot fired. */ }; + +} \ No newline at end of file diff --git a/game/src/EnemyManager.cpp b/game/src/EnemyManager.cpp index 5e2c732735a67c89dd1962f4c9e0a2617217a75a..3bbbbf9103ce80f08204d4dd8c1e9e7548db81c7 100644 --- a/game/src/EnemyManager.cpp +++ b/game/src/EnemyManager.cpp @@ -1,5 +1,8 @@ #include "EnemyManager.hpp" +namespace game +{ + EnemyManager::EnemyManager(b2World *world, BulletManager &bulletManager, TilesheetManager &tilesheetManager, lvl::Level &level) : m_world(world), m_bulletManager(bulletManager), m_tilesheetManager(tilesheetManager) @@ -65,4 +68,6 @@ void EnemyManager::cleanup() delete enemy; } m_enemies.clear(); +} + } \ No newline at end of file diff --git a/game/src/EnemyManager.hpp b/game/src/EnemyManager.hpp index 215a977ffa0fefddd4d49d4a1b3b4d91a7e49fdf..1101f39069acd3bf81a3b3e63bde285e5de8dd50 100644 --- a/game/src/EnemyManager.hpp +++ b/game/src/EnemyManager.hpp @@ -7,6 +7,9 @@ #include <box2d/box2d.h> #include <vector> +namespace game +{ + /** * @class EnemyManager * @brief A class responsible for managing and handling multiple enemies in the game. @@ -84,3 +87,5 @@ class EnemyManager */ void cleanup(); }; + +} \ No newline at end of file diff --git a/game/src/GameContext.cpp b/game/src/GameContext.cpp index 30a331ab5c84280debbea5876e6af7c84b055b64..abeea07cfa7dd1271960dad32085d3d24b0ff6d0 100644 --- a/game/src/GameContext.cpp +++ b/game/src/GameContext.cpp @@ -4,6 +4,9 @@ #include <box2d/b2_math.h> #include <unordered_set> +namespace game +{ + GameContext::GameContext(lvl::Level &level, EnemyManager &enemy_manager, BulletManager &bullet_manager, TilesheetManager &tilesheet_manager, ObjectManager &object_manager, Player &player, SDL_Renderer* renderer, Camera &camera) : m_level(level), m_bulletManager(bullet_manager), m_enemyManager(enemy_manager), m_objectManager(object_manager), @@ -134,4 +137,6 @@ void GameContext::loadRoom(const lvl::Room &next_room) lvl::Room &GameContext::getCurrentRoom() { return m_current_room; +} + } \ No newline at end of file diff --git a/game/src/GameContext.hpp b/game/src/GameContext.hpp index 2570f5751cd0dbcf94181ee3dfc77f463f33aab3..fe74eee48c3f528d71adae0e2ba74e8253b48a69 100644 --- a/game/src/GameContext.hpp +++ b/game/src/GameContext.hpp @@ -10,6 +10,9 @@ #include "level.hpp" #include "room.hpp" +namespace game +{ + /** * @class GameContext * @brief Manages the game's core context, handling levels, rooms, and game objects. @@ -82,3 +85,5 @@ class GameContext SDL_Renderer* m_renderer; ///< Pointer to the SDL renderer. int m_tileSize; ///< Tile size used in the game (respects scale factor). }; + +} \ No newline at end of file diff --git a/game/src/GameInitializer.cpp b/game/src/GameInitializer.cpp index 8d126cf225d81bcbe926d3d0f6d1f56e319d39f3..8f91dcf72a387403047c3b363c0a170aeb5e47f8 100644 --- a/game/src/GameInitializer.cpp +++ b/game/src/GameInitializer.cpp @@ -6,7 +6,7 @@ int main() { try { - GameWindow game(640, 640, 2.0f); + game::GameWindow game(640, 640, 2.0f); game.run(); } catch (const std::runtime_error &ex) diff --git a/game/src/GameObject.cpp b/game/src/GameObject.cpp index ff89e2ea816e50e829cf7c1490c0418d5e89d3ab..adff118a388fea4a68e8d50cc137cdb55eb76815 100644 --- a/game/src/GameObject.cpp +++ b/game/src/GameObject.cpp @@ -2,6 +2,9 @@ #include "TilesheetManager.hpp" #include <box2d/b2_body.h> +namespace game +{ + GameObject::GameObject(b2World *world, const b2Vec2 &position, const b2Vec2 &size, float density, float scale, float friction, const std::vector<int> &tileIDs, bool isBullet, bool isDynamic) : m_world(world), m_size(scale * size), m_frameDuration(0.0f), m_lastFrameSwitch(0.0f), m_currentFrame(tileIDs[0]), @@ -104,4 +107,6 @@ void GameObject::nextFrame() float GameObject::getPixelsPerMeterScaled() const { return m_pixelsPerMeterScaled; +} + } \ No newline at end of file diff --git a/game/src/GameObject.hpp b/game/src/GameObject.hpp index aaabc5efe9e719734b43e809d0e5461e14dc57c6..3e9bd516fe96bd8f9ba7e42b08005230127c412b 100644 --- a/game/src/GameObject.hpp +++ b/game/src/GameObject.hpp @@ -5,6 +5,9 @@ #include <box2d/box2d.h> #include <vector> +namespace game +{ + constexpr float pixelsPerMeter = 20.0; /**< Conversion factor from meters to pixels. */ /** @@ -124,3 +127,5 @@ class GameObject const std::vector<int> m_tileIDs; /**< List of tile IDs representing the animation frames */ float m_pixelsPerMeterScaled; /**< Conversion factor from meters to pixels. */ }; + +} \ No newline at end of file diff --git a/game/src/GameWindow.cpp b/game/src/GameWindow.cpp index 24c36d53932c23f2841f2689a0cefe838da71483..a99e81a8e9108befbbbef3c0f7a611ce1478f851 100644 --- a/game/src/GameWindow.cpp +++ b/game/src/GameWindow.cpp @@ -1,6 +1,9 @@ #include "GameWindow.hpp" #include "TilesheetManager.hpp" +namespace game +{ + GameWindow::GameWindow(const int32_t width, const int32_t height, const float_t scale) noexcept(false) : SDLApplication("ISAAC is Back", width, height), m_Score(0), m_Scale(scale), m_level("level.h5"), m_world(b2Vec2({0.0f, 0.0f})), m_tilesheetManager(m_Renderer, m_level.getSpritesheet(), m_Scale), @@ -95,3 +98,5 @@ b2Vec2 GameWindow::getPlayerPosition() const { return m_player.getPosition(); } + +} diff --git a/game/src/GameWindow.hpp b/game/src/GameWindow.hpp index e790474a95a54d781fde6bbaebbd1eee54eea410..aa1514fe893c85cc17a15e44bf4695d7fec488f1 100644 --- a/game/src/GameWindow.hpp +++ b/game/src/GameWindow.hpp @@ -17,6 +17,9 @@ #include <memory> #include <vector> +namespace game +{ + // Forward declarations class EnemyManager; @@ -116,3 +119,5 @@ class GameWindow : public SDLApplication Player m_player; /**< A unique pointer to the player object. */ Camera m_Camera; }; + +} diff --git a/game/src/ObjectManager.cpp b/game/src/ObjectManager.cpp index 48217c2794db0bf810ab32ddd5990537f24aba85..d544ed7c09d2a8c049e6efa5e02a4f43c85ba88b 100644 --- a/game/src/ObjectManager.cpp +++ b/game/src/ObjectManager.cpp @@ -1,5 +1,8 @@ #include "ObjectManager.hpp" +namespace game +{ + ObjectManager::ObjectManager(lvl::Level &level, b2World *world, TilesheetManager &tilesheetManager) : m_world(world), m_tilesheetManager(tilesheetManager) { @@ -20,4 +23,6 @@ void ObjectManager::addDoor(const b2Vec2 &position) m_tilesheetManager.getGameScale(), 0.0f, std::vector<int>{-1}); new_object->getBody()->GetUserData().pointer = 5; // 5 = Door (idenfier for contact listener) m_doors.emplace_back(new_object); +} + } \ No newline at end of file diff --git a/game/src/ObjectManager.hpp b/game/src/ObjectManager.hpp index 71b9c30ea5f0f9419097844c0399243bfedd8fb8..9c1fb04755e86f0d26d38f1a3564a3df72cb272f 100644 --- a/game/src/ObjectManager.hpp +++ b/game/src/ObjectManager.hpp @@ -4,6 +4,9 @@ #include "level.hpp" #include <box2d/box2d.h> +namespace game +{ + class ObjectManager { private: @@ -39,4 +42,6 @@ class ObjectManager * @param position The position where the new object will be placed in the world. */ void addDoor(const b2Vec2 &position); -}; \ No newline at end of file +}; + +} \ No newline at end of file diff --git a/game/src/Player.cpp b/game/src/Player.cpp index cae03ff659e8af0b8f5ae6f65576037d3519ae08..295777e0e7eb01ef5d33f2b9c04b40d34c6b3404 100644 --- a/game/src/Player.cpp +++ b/game/src/Player.cpp @@ -1,5 +1,8 @@ #include "Player.hpp" +namespace game +{ + Player::Player(b2World *world, const b2Vec2 &position, const b2Vec2 &size, float density, float scale, float friction, BulletManager &bulletmanager, TilesheetManager &tilesheetManager, const std::vector<int> &tileIDs, int health, int damage) : DynamicObject(world, position, size, density, scale, friction, tileIDs, false), m_alive(true), @@ -116,3 +119,5 @@ b2Body *Player::getBody() { return m_body; } + +} \ No newline at end of file diff --git a/game/src/Player.hpp b/game/src/Player.hpp index 97a32ff7f5b5b7a1682ea1da98c0a7edfbef4d28..7ded0fb2742f9e5e1818af0986e25b07ffe4f34b 100644 --- a/game/src/Player.hpp +++ b/game/src/Player.hpp @@ -4,6 +4,9 @@ #include <SDL2/SDL.h> #include <box2d/b2_body.h> +namespace game +{ + /** * @class Player * @brief A class representing the player character in the game. @@ -89,3 +92,5 @@ class Player : public DynamicObject Uint32 m_lastFire; /**< The timestamp of the last shot fired. */ BulletManager &m_bulletManager; /**< A reference to the BulletManager object used for managing fired projectiles. */ }; + +} \ No newline at end of file diff --git a/game/src/Renderable.cpp b/game/src/Renderable.cpp index 25ada0702a4fba514678cfa93a4c01fd595a65fb..6cab713852ef537e82813c5a463d3e4b82de1cce 100644 --- a/game/src/Renderable.cpp +++ b/game/src/Renderable.cpp @@ -1,6 +1,9 @@ #include "Renderable.hpp" #include "GameWindow.hpp" +namespace game +{ + Renderable::Renderable(GameWindow *window, const std::string &filePath) : m_window(window), m_renderer(window->renderer()) { @@ -80,4 +83,6 @@ int Renderable::x() const int Renderable::y() const { return m_targetRect.y; +} + } \ No newline at end of file diff --git a/game/src/Renderable.hpp b/game/src/Renderable.hpp index d5e3b3dc3aaa664eaa126583d8cc06866300274c..3a2b8c25cf37061c36b4ddf4286794be929eaa55 100644 --- a/game/src/Renderable.hpp +++ b/game/src/Renderable.hpp @@ -6,6 +6,9 @@ #include <iostream> #include <string> +namespace game +{ + /** * @class Renderable * @brief A class representing an object that can be rendered to the screen. @@ -108,3 +111,5 @@ class Renderable */ void computeSourceRect(); }; + +} \ No newline at end of file diff --git a/game/src/SDLApplication.cpp b/game/src/SDLApplication.cpp index b45d6d9cd7e0a7814a2986cab2470cee6ba23351..94e1af7bfd7ca8b9e23e3b86706e0d941f1910b6 100644 --- a/game/src/SDLApplication.cpp +++ b/game/src/SDLApplication.cpp @@ -1,5 +1,8 @@ #include "SDLApplication.hpp" +namespace game +{ + SDLApplication::SDLApplication(const std::string &title, const int width, const int height) : m_Title(title), m_Width(width), m_Height(height), m_Running(true), m_SDLInitialized(false), m_Window(nullptr), m_Renderer(nullptr) @@ -64,4 +67,6 @@ void SDLApplication::run() const float elapsed = (frameEnd - frameStart) / static_cast<float>(SDL_GetPerformanceFrequency()); SDL_Delay(std::max(0.0f, 16.666f - elapsed)); } +} + } \ No newline at end of file diff --git a/game/src/SDLApplication.hpp b/game/src/SDLApplication.hpp index cc4252af6d679a415d2c060bd1da4d4ece7f6aa3..8cf5adfd4bb7dffa5125d51c163c21baa25ed2fb 100644 --- a/game/src/SDLApplication.hpp +++ b/game/src/SDLApplication.hpp @@ -3,6 +3,9 @@ #include <stdexcept> #include <string> +namespace game +{ + constexpr float TIMESTEP = 1.0f / 60.0f; constexpr int32_t VELOCITY_ITERATIONS = 6; constexpr int32_t POSITION_ITERATIONS = 2; @@ -76,3 +79,5 @@ class SDLApplication */ SDL_Renderer *m_Renderer; }; + +} \ No newline at end of file diff --git a/game/src/StaticObject.cpp b/game/src/StaticObject.cpp index 67acb9c1470938c48450c30911bd5af5043bc91c..4176eb81c4fb386ede813e0cdfdce28a11946e9c 100644 --- a/game/src/StaticObject.cpp +++ b/game/src/StaticObject.cpp @@ -1,5 +1,8 @@ #include "StaticObject.hpp" +namespace game +{ + StaticObject::StaticObject(b2World *world, const b2Vec2 &position, const b2Vec2 &size, float scale, float friction, const std::vector<int> &tileIDs) : GameObject(world, position, size, 0.0f, scale, friction, tileIDs, false, false) @@ -22,4 +25,6 @@ void StaticObject::render() b2Body *StaticObject::getBody() { return m_body; +} + } \ No newline at end of file diff --git a/game/src/StaticObject.hpp b/game/src/StaticObject.hpp index e98c59c748ba60c73cf699fa2093516006c3d901..38995f90b00d41da926b5a844cce32b00cb7fdb9 100644 --- a/game/src/StaticObject.hpp +++ b/game/src/StaticObject.hpp @@ -1,6 +1,10 @@ #pragma once #include "GameObject.hpp" + +namespace game +{ + /** * @class StaticObject * @brief A class representing a static object in the game world. @@ -40,3 +44,5 @@ class StaticObject : public GameObject */ b2Body *getBody(); }; + +} \ No newline at end of file diff --git a/game/src/TilesheetManager.cpp b/game/src/TilesheetManager.cpp index bb5744b29e46596951b7380d4ab74164d8ae9e40..6fc4ce7e573407400c6f4f98e75e7f8a3e18382f 100644 --- a/game/src/TilesheetManager.cpp +++ b/game/src/TilesheetManager.cpp @@ -1,6 +1,9 @@ #include "TilesheetManager.hpp" #include "room.hpp" +namespace game +{ + TilesheetManager::TilesheetManager(SDL_Renderer *renderer, const lvl::Spritesheet &spritesheet, float scale) : m_renderer(renderer), m_tilesheetTexture(nullptr), m_Spritesheet(spritesheet), m_scale(scale) { @@ -119,4 +122,6 @@ void TilesheetManager::renderBackground(const lvl::Room &room, const Camera &cam rendered_y++; } } +} + } \ No newline at end of file diff --git a/game/src/TilesheetManager.hpp b/game/src/TilesheetManager.hpp index 17ea7090f96f6f5e53a8ec4340dcb822105f3607..1cc84792a8d4712902bbdbcd5585e79e27d624c1 100644 --- a/game/src/TilesheetManager.hpp +++ b/game/src/TilesheetManager.hpp @@ -6,6 +6,9 @@ #include <SDL2/SDL.h> #include <SDL2/SDL_image.h> +namespace game +{ + /** * @class TilesheetManager * @brief Handles the rendering of tiles from a spritesheet (respects gamescale). @@ -67,3 +70,5 @@ class TilesheetManager */ void loadTexture(SDL_Renderer *renderer); }; + +} \ No newline at end of file diff --git a/game/src/Vector.hpp b/game/src/Vector.hpp index 777bef5dc678231db6254bd99be16182e246f93b..238f708edb38cc0df6d3b247d3d9f05d33b97831 100644 --- a/game/src/Vector.hpp +++ b/game/src/Vector.hpp @@ -11,6 +11,9 @@ #pragma once #include <iostream> +namespace game +{ + /** * @brief A class to represent a Vector */ @@ -131,4 +134,6 @@ template <typename T> Vector<T> operator*(T s, const Vector<T> &v); typedef Vector<double> Vector2f; typedef Vector<int> Pixel; +} + #include "Vector.tcc" \ No newline at end of file diff --git a/game/src/Vector.tcc b/game/src/Vector.tcc index 3227f5b8754050683fe9ca5839a5a66724b2f840..de8d244683fcbbdfdc9869c6dc5aba28e0fc9e31 100644 --- a/game/src/Vector.tcc +++ b/game/src/Vector.tcc @@ -1,3 +1,6 @@ +namespace game +{ + /* * Vector<T>.cpp * Created on: Dec 08, 2017 @@ -103,4 +106,6 @@ template <typename T> void Vector<T>::operator-=(const Vector<T> &other) { m_x -= other.m_x; m_y -= other.m_y; +} + } \ No newline at end of file