mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-04 02:36:31 +00:00
fix compile errors
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user