Conversation
core/CMakeLists.txt
Outdated
| world/entity/EntityStorage.cpp world/entity/EntityStorage.hpp | ||
| world/entity/ViewableEntity.hpp world/entity/ViewableEntity.cpp | ||
| world/entity/Entity.hpp world/entity/Entity.cpp | ||
| world/entity/Mobs/Mob.hpp |
There was a problem hiding this comment.
папки называются с маленькой буквы везде
| @@ -0,0 +1,14 @@ | |||
| #include "Controller.hpp" | |||
| #include <spdlog/spdlog.h> | |||
There was a problem hiding this comment.
Неправильный стиль иклюдов....
Controller
event/...
world/...
spdlog/...
utility
| @@ -0,0 +1,49 @@ | |||
| #include "MobController.hpp" | |||
| #include "event/system/KeyPressed.hpp" | |||
There was a problem hiding this comment.
Неправильный стиль инклюдов, ещё кавычки не те
| } | ||
| void mad::core::MobController::control() { | ||
| for (Entity::Id entity_id : m_storage->extract(TagFilter(Entity::Type::Enemy))) { | ||
| if (&m_storage->get_entity(entity_id) != nullptr && cast_to_or_null<Mob>(m_storage->get_entity(entity_id)) != nullptr) { |
There was a problem hiding this comment.
В чём смысл этой проверки? clion вроде это должен подсвечивать. Тебе get_entity вернул какой-то объект, у него конечно адрес не nullptr
| @@ -0,0 +1,49 @@ | |||
| #include "MobController.hpp" | |||
| #include "event/system/KeyPressed.hpp" | |||
| #include "world/entity/Mobs/Mob.hpp" | |||
There was a problem hiding this comment.
MobController - это определённая стратегия, по которой ведёт себя моб. То есть это уже относится к тому, как именно игра играется. поэтому это должно быть в папке ./game. Например, ./game/mobs/MobController
core/world/entity/Entity.hpp
Outdated
| using Id = std::int32_t; | ||
|
|
||
| public: | ||
| enum class Type { |
There was a problem hiding this comment.
Не понимаю зачем нужен этот тип
core/world/filter/TagFilter.hpp
Outdated
| namespace mad::core { | ||
|
|
||
| struct TagFilter : Filter { | ||
| explicit TagFilter(Entity::Type filter_tag) : Filter(Filter::Type::EntityTag), m_filter_tag(filter_tag) { |
There was a problem hiding this comment.
Тэгов ведь может быть сколь угодно много. Думаю для них лучше использовать строки, а не enum-ы. И так можно будет избавиться от Entity::Type
| } | ||
|
|
||
| private: | ||
| Vec2d p; |
|
|
||
| private: | ||
| Vec2d p; | ||
| float r; |
| private: | ||
| Vec2d p; | ||
| float r; | ||
| Entity::Type m_filter_tag; |
No description provided.