From dbd95c73d577bb632bda4cde01e935ab58cac43d Mon Sep 17 00:00:00 2001 From: Bluub Date: Fri, 4 Jun 2021 00:15:13 +0200 Subject: [PATCH] removing positino in controllable component --- CMakeLists.txt | 4 +- sources/Component/IA/IAComponent.cpp | 37 ------------------- .../IAControllableComponent.cpp | 23 ++++++++++++ .../IAControllableComponent.hpp} | 22 +++-------- 4 files changed, 30 insertions(+), 56 deletions(-) delete mode 100644 sources/Component/IA/IAComponent.cpp create mode 100644 sources/Component/IAControllable/IAControllableComponent.cpp rename sources/Component/{IA/IAComponent.hpp => IAControllable/IAControllableComponent.hpp} (50%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 04975fa6..e9c7901c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,8 +72,8 @@ set(SOURCES sources/Component/Collision/CollisionComponent.hpp sources/System/Collision/CollisionSystem.hpp sources/System/Collision/CollisionSystem.cpp - sources/Component/IA/IAComponent.hpp - sources/Component/IA/IAComponent.cpp + sources/Component/IAControllable/IAControllableComponent.hpp + sources/Component/IAControllable/IAControllableComponent.cpp ) add_executable(bomberman diff --git a/sources/Component/IA/IAComponent.cpp b/sources/Component/IA/IAComponent.cpp deleted file mode 100644 index 6d6ed180..00000000 --- a/sources/Component/IA/IAComponent.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* -** EPITECH PROJECT, 2021 -** Bomberman -** File description: -** IAComponent -*/ - -#include "IAComponent.hpp" -#include "lua.h" - -namespace BBM -{ - IAComponent::IAComponent(WAL::Entity &entity, std::string scriptPath) - : Component(entity), - _scriptPath(scriptPath) - { } - - IAComponent::IAComponent(WAL::Entity &entity) - : Component(entity), - _scriptPath() - { } - - WAL::Component *IAComponent::clone(WAL::Entity &entity) const - { - return new IAComponent(entity); - } - - Vector3f IAComponent::getPosition(void) const - { - return (this->_pos); - } - - void IAComponent::setPosition(Vector3f &pos) - { - this->_pos = pos; - } -} diff --git a/sources/Component/IAControllable/IAControllableComponent.cpp b/sources/Component/IAControllable/IAControllableComponent.cpp new file mode 100644 index 00000000..18905d25 --- /dev/null +++ b/sources/Component/IAControllable/IAControllableComponent.cpp @@ -0,0 +1,23 @@ +/* +** EPITECH PROJECT, 2021 +** Bomberman +** File description: +** IAControllableComponent +*/ + +#include "IAControllableComponent.hpp" +#include "lua.h" + +namespace BBM +{ + IAControllableComponent::IAControllableComponent(WAL::Entity &entity, std::string scriptPath) + : Component(entity), + _scriptPath(scriptPath) + { } + + WAL::Component *IAControllableComponent::clone(WAL::Entity &entity) const + { + return new IAControllableComponent(entity, _scriptPath); + } + +} diff --git a/sources/Component/IA/IAComponent.hpp b/sources/Component/IAControllable/IAControllableComponent.hpp similarity index 50% rename from sources/Component/IA/IAComponent.hpp rename to sources/Component/IAControllable/IAControllableComponent.hpp index fdc1ed4a..bd4158a9 100644 --- a/sources/Component/IA/IAComponent.hpp +++ b/sources/Component/IAControllable/IAControllableComponent.hpp @@ -14,39 +14,27 @@ namespace BBM { - class IAComponent : public WAL::Component + class IAControllableComponent : public WAL::Component { private: - - Vector3f _pos; const std::string _scriptPath; public: - //! @brief get IA Position - Vector3f getPosition(void) const; - - //! @param pos Position of the player - //! @brief set IA position - void setPosition(Vector3f &); - //! @inherit WAL::Component *clone(WAL::Entity &entity) const override; - - //! @brief A IA component can't be instantiated, it should be derived. - explicit IAComponent(WAL::Entity &entity); //! @brief Constructor - IAComponent(WAL::Entity &entity, std::string scripPath); + IAControllableComponent(WAL::Entity &entity, std::string scripPath); //! @brief A IA component can't be instantiated, it should be derived. - IAComponent(const IAComponent &) = default; + IAControllableComponent(const IAControllableComponent &) = default; //! @brief default destructor - ~IAComponent() override = default; + ~IAControllableComponent() override = default; //! @brief A IA component can't be assigned - IAComponent &operator=(const IAComponent &) = delete; + IAControllableComponent &operator=(const IAControllableComponent &) = delete; protected: }; }