mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-28 08:33:36 +00:00
fix compile errors
This commit is contained in:
+2
-2
@@ -3,8 +3,8 @@ project(bomberman)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCC)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -Wshadow -W -Werror -g")
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -Wshadow -Wno-unused-param -W -Werror -g")
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
|
||||
|
||||
|
||||
@@ -3,6 +3,11 @@ project(wal)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -Wshadow -W -Werror -Wno-unused-param -g")
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
|
||||
|
||||
add_library(wal
|
||||
sources/Entity/Entity.hpp
|
||||
sources/Component/Component.hpp
|
||||
|
||||
@@ -13,17 +13,17 @@ namespace WAL
|
||||
|
||||
Entity::Entity(Scene &scene, std::string name, bool notifyScene)
|
||||
: _uid(Entity::nextID++),
|
||||
_scene(scene),
|
||||
_name(std::move(name)),
|
||||
_notifyScene(notifyScene)
|
||||
_notifyScene(notifyScene),
|
||||
_scene(scene)
|
||||
{ }
|
||||
|
||||
Entity::Entity(const Entity &other)
|
||||
: _uid(Entity::nextID++),
|
||||
_scene(other._scene),
|
||||
_name(other._name),
|
||||
_disabled(other._disabled),
|
||||
_notifyScene(other._notifyScene)
|
||||
_notifyScene(other._notifyScene),
|
||||
_scene(other._scene)
|
||||
{
|
||||
for (const auto &cmp : other._components)
|
||||
this->addComponent(*cmp.second);
|
||||
|
||||
@@ -34,8 +34,8 @@ namespace WAL
|
||||
for (auto &view : this->_views) {
|
||||
if (std::find(view->getTypes().begin(), view->getTypes().end(), type) == view->getTypes().end())
|
||||
continue;
|
||||
bool valid = std::all_of(view->getTypes().begin(), view->getTypes().end(), [&entity](const auto &type){
|
||||
return entity.hasComponent(type);
|
||||
bool valid = std::all_of(view->getTypes().begin(), view->getTypes().end(), [&entity](const auto <ype){
|
||||
return entity.hasComponent(ltype);
|
||||
});
|
||||
if (valid)
|
||||
view->emplace_back(entity);
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace BBM
|
||||
//! @brief Constructor with the 3 callback
|
||||
ButtonComponent(WAL::Entity &entity, WAL::Callback<WAL::Entity &, WAL::Wal &> callback)
|
||||
: WAL::Component(entity),
|
||||
onEvent(callback), _up(nullptr), _down(nullptr), _left(nullptr), _right(nullptr)
|
||||
onEvent(callback), _up(nullptr), _down(nullptr), _right(nullptr), _left(nullptr)
|
||||
{ }
|
||||
|
||||
ButtonComponent &setButtonLinks(WAL::Entity *up = nullptr, WAL::Entity *down = nullptr,
|
||||
|
||||
@@ -29,8 +29,8 @@ namespace BBM
|
||||
{}
|
||||
|
||||
//! @brief Create a new vector2 representing a specific coordinate.
|
||||
Vector2(T x, T y)
|
||||
: x(x), y(y)
|
||||
Vector2(T _x, T _y)
|
||||
: x(_x), y(_y)
|
||||
{}
|
||||
|
||||
//! @brief A default destructor
|
||||
|
||||
@@ -29,8 +29,8 @@ namespace BBM
|
||||
{}
|
||||
|
||||
//! @brief Create a new vector3 representing a specific coordinate.
|
||||
Vector3(T x, T y, T z)
|
||||
: x(x), y(y), z(z)
|
||||
Vector3(T _x, T _y, T _z)
|
||||
: x(_x), y(_y), z(_z)
|
||||
{}
|
||||
|
||||
//! @brief A default destructor
|
||||
|
||||
Reference in New Issue
Block a user