Fixing PR issues

This commit is contained in:
Zoe Roux
2021-05-18 09:42:18 +02:00
parent ad81137c96
commit c6012f1be6
9 changed files with 17 additions and 12 deletions

View File

@@ -33,7 +33,7 @@ add_library(wal
target_include_directories(wal PUBLIC sources) target_include_directories(wal PUBLIC sources)
add_executable(wal_tests add_executable(wal_tests EXCLUDE_FROM_ALL
tests/EntityTests.cpp tests/EntityTests.cpp
tests/MainTest.cpp tests/MainTest.cpp
tests/EngineTests.cpp tests/EngineTests.cpp

View File

@@ -1,5 +1,6 @@
//
// Created by Zoe Roux on 2021-05-14.
//
#pragma once #pragma once

View File

@@ -1,4 +1,6 @@
//
// Created by Zoe Roux on 2021-05-14.
//
#pragma once #pragma once
@@ -44,7 +46,7 @@ namespace WAL
T &getComponent() T &getComponent()
{ {
const std::type_info &type = typeid(T); const std::type_info &type = typeid(T);
auto existing = std::find_if(this->_components.begin(), this->_components.end(), [&type] (auto &cmp) { auto existing = std::find_if(this->_components.begin(), this->_components.end(), [&type] (const auto &cmp) {
return typeid(*cmp) == type; return typeid(*cmp) == type;
}); });
if (existing == this->_components.end()) if (existing == this->_components.end())
@@ -88,7 +90,7 @@ namespace WAL
Entity &removeComponent() Entity &removeComponent()
{ {
const std::type_info &type = typeid(T); const std::type_info &type = typeid(T);
auto existing =std::find_if(this->_components.begin(), this->_components.end(), [&type] (auto &cmp) { auto existing = std::find_if(this->_components.begin(), this->_components.end(), [&type] (const auto &cmp) {
return typeid(*cmp) == type; return typeid(*cmp) == type;
}); });
if (existing == this->_components.end()) if (existing == this->_components.end())

View File

@@ -8,7 +8,7 @@ namespace WAL
{ {
std::vector<Entity> &Scene::getEntities() std::vector<Entity> &Scene::getEntities()
{ {
return this->_entity; return this->_entities;
} }
} }

View File

@@ -15,7 +15,7 @@ namespace WAL
{ {
private: private:
//! @brief The list of registered entities //! @brief The list of registered entities
std::vector<Entity> _entity; std::vector<Entity> _entities;
public: public:
//! @brief Get the list of entities. //! @brief Get the list of entities.
std::vector<Entity> &getEntities(); std::vector<Entity> &getEntities();

View File

@@ -20,7 +20,7 @@ namespace WAL
//! @return The manager instance used to call this function is returned. This allow method chaining. //! @return The manager instance used to call this function is returned. This allow method chaining.
SceneManager &addScene(Scene &&scene); SceneManager &addScene(Scene &&scene);
//! @brief Add a scene before the current scene to allow //! @brief Add a scene before the current scene. This could be useful for lobbies or scene where the next scene can be constructed.
//! @return The manager instance used to call this function is returned. This allow method chaining. //! @return The manager instance used to call this function is returned. This allow method chaining.
SceneManager &addBackScene(Scene &&scene); SceneManager &addBackScene(Scene &&scene);

View File

@@ -1,4 +1,6 @@
//
// Created by Zoe Roux on 2021-05-14.
//
#pragma once #pragma once

View File

@@ -11,7 +11,7 @@ namespace WAL
{ {
std::chrono::nanoseconds Wal::timestep = 8ms; std::chrono::nanoseconds Wal::timestep = 8ms;
SceneManager &Wal::getSceneManger() SceneManager &Wal::getSceneManager()
{ {
return this->_scenes; return this->_scenes;
} }

View File

@@ -101,7 +101,7 @@ namespace WAL
} }
//! @brief Get the scene manager. //! @brief Get the scene manager.
SceneManager &getSceneManger(); SceneManager &getSceneManager();
//! @brief Start the game loop //! @brief Start the game loop
void run(); void run();