diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..b18963f4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: true +contact_links: + - name: Game issue + about: Create an Game related issue + url: https://github.com/AnonymusRaccoon/Bomberman/issues/new?projects=AnonymusRaccoon/Bomberman/2&labels=Game + - name: ECS issue + about: Create an ECS related issue + url: https://github.com/AnonymusRaccoon/Bomberman/issues/new?projects=AnonymusRaccoon/Bomberman/1&labels=ECS + - name: Renderer issue + about: Create an Renderer/Encapsulation related issue + url: https://github.com/AnonymusRaccoon/Bomberman/issues/new?projects=AnonymusRaccoon/Bomberman/3&labels=Renderer \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..2753adaa --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,24 @@ +## Proposed changes + +### Make sure that the pull request is going to `develop` branch + +### Add all necessary labels to understand with ease the scope of this pull request + +Describe here the big picture of your changes here to communicate to the others members of the group and why we should accept this pull request. + +### If it fixes a bug or resolves a feature request, be sure to link to that issue. + +## Information +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] Non-breaking changes + +## Checklist + +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] I have added necessary documentation + +## Further comments + +### If not needed, remove this section +If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did +and what alternatives you considered, etc... diff --git a/.github/workflows/codingstyle.yml b/.github/workflows/codingstyle.yml new file mode 100644 index 00000000..c8456f8d --- /dev/null +++ b/.github/workflows/codingstyle.yml @@ -0,0 +1,13 @@ +name: Check coding style +on: [push] + +jobs: + Building: + runs-on: [ubuntu-latest] + steps: + - uses: actions/checkout@v1 + - name: Install cpplint + run: pip install cpplint + - name: Check coding style + run: | + cpplint --recursive --quiet --verbose=3 . \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 00000000..67b0e2dd --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Bomberman + +Repository link: https://github.com/AnonymusRaccoon/Bomberman/ diff --git a/eCPPLINT.cfg b/eCPPLINT.cfg new file mode 100644 index 00000000..bfbf40cd --- /dev/null +++ b/eCPPLINT.cfg @@ -0,0 +1,24 @@ + +# Don't search for additional CPPLINT.cfg in parent directories. +set noparent +# Use 'ART_' as the cpp header guard prefix (e.g. #ifndef ART_PATH_TO_FILE_H_). +root=. +# Limit line length. +linelength=120 +# Ignore the following categories of errors, as specified by the filter: +# (the filter settings are concatenated together) +filter=-build/c++11 +filter=-whitespace/tab +filter=-whitespace/braces +filter=-legal/copyright +filter=-runtime/indentation_namespace +filter=-whitespace/ending_newline +filter=-build/header_guard +filter=-readability/todo +filter=-whitespace/comments +filter=-whitespace/indent # due to public class rule + + +exclude_files=cmake-build-debug/* +exclude_files=build/* +exclude_files=tests/* \ No newline at end of file diff --git a/lib/wal/eCPPLINT.cfg b/lib/wal/eCPPLINT.cfg new file mode 100644 index 00000000..9992b3d2 --- /dev/null +++ b/lib/wal/eCPPLINT.cfg @@ -0,0 +1,4 @@ +# Use 'ART_' as the cpp header guard prefix (e.g. #ifndef ART_PATH_TO_FILE_H_). +root=. + +exclude_files=tests/* \ No newline at end of file diff --git a/lib/wal/sources/Component/Component.cpp b/lib/wal/sources/Component/Component.cpp index fb4e1279..aba34221 100644 --- a/lib/wal/sources/Component/Component.cpp +++ b/lib/wal/sources/Component/Component.cpp @@ -22,11 +22,11 @@ namespace WAL void Component::onStart() { - //TODO handle events here + // TODO handle events here } void Component::onStop() { - //TODO handle events here + // TODO handle events here } -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Component/Component.hpp b/lib/wal/sources/Component/Component.hpp index b2441383..33794d89 100644 --- a/lib/wal/sources/Component/Component.hpp +++ b/lib/wal/sources/Component/Component.hpp @@ -12,7 +12,7 @@ namespace WAL { //! @brief The entity class, used to prevent circular dependencies. class Entity; - + //! @brief Represent a single component of WAL. class Component { @@ -37,7 +37,7 @@ namespace WAL //! @param entity The entity that owns the ne component. virtual Component *clone(Entity &entity) const = 0; - //! @brief Used if the component is disabled + //! @brief Used if the component is disabled bool isDisabled() const; //! @brief Disable this component. void setDisable(bool disabled); @@ -48,4 +48,4 @@ namespace WAL //! @brief The entity or this component has just been disable. virtual void onStop(); }; -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Entity/Entity.cpp b/lib/wal/sources/Entity/Entity.cpp index 9a59447b..56627a16 100644 --- a/lib/wal/sources/Entity/Entity.cpp +++ b/lib/wal/sources/Entity/Entity.cpp @@ -3,7 +3,7 @@ // #include "Entity/Entity.hpp" - +#include #include namespace WAL @@ -67,4 +67,4 @@ namespace WAL }); return existing != this->_components.end(); } -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Entity/Entity.hpp b/lib/wal/sources/Entity/Entity.hpp index 5f4b21ca..f0c3d641 100644 --- a/lib/wal/sources/Entity/Entity.hpp +++ b/lib/wal/sources/Entity/Entity.hpp @@ -34,7 +34,7 @@ namespace WAL //! @brief Get the name fo the entity std::string getName() const; - //! @brief Used if the entity is disabled + //! @brief Used if the entity is disabled bool isDisable() const; //! @brief Disable this entity. @@ -114,4 +114,4 @@ namespace WAL //! @brief An entity is assignable Entity &operator=(const Entity &) = default; }; -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Exception/WalError.cpp b/lib/wal/sources/Exception/WalError.cpp index 53581300..c1039567 100644 --- a/lib/wal/sources/Exception/WalError.cpp +++ b/lib/wal/sources/Exception/WalError.cpp @@ -2,6 +2,7 @@ // Created by Zoe Roux on 2021-05-14. // +#include #include "WalError.hpp" namespace WAL @@ -17,4 +18,4 @@ namespace WAL NotFoundError::NotFoundError(const std::string &what) : WalError(what) {} -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Exception/WalError.hpp b/lib/wal/sources/Exception/WalError.hpp index 0c791647..d7c04c96 100644 --- a/lib/wal/sources/Exception/WalError.hpp +++ b/lib/wal/sources/Exception/WalError.hpp @@ -7,6 +7,7 @@ #include #include +#include namespace WAL { @@ -51,4 +52,4 @@ namespace WAL //! @brief A default assignment operator NotFoundError &operator=(const NotFoundError &) = default; }; -} +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Models/Callback.hpp b/lib/wal/sources/Models/Callback.hpp index 334d39a7..be2c092f 100644 --- a/lib/wal/sources/Models/Callback.hpp +++ b/lib/wal/sources/Models/Callback.hpp @@ -6,6 +6,8 @@ #pragma once #include +#include +#include namespace WAL { @@ -57,4 +59,4 @@ namespace WAL this->addCallback(callback); } }; -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Scene/Scene.cpp b/lib/wal/sources/Scene/Scene.cpp index b0a3b3a7..0ec83228 100644 --- a/lib/wal/sources/Scene/Scene.cpp +++ b/lib/wal/sources/Scene/Scene.cpp @@ -10,5 +10,4 @@ namespace WAL { return this->_entities; } -} - +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Scene/Scene.hpp b/lib/wal/sources/Scene/Scene.hpp index 00329172..3491170e 100644 --- a/lib/wal/sources/Scene/Scene.hpp +++ b/lib/wal/sources/Scene/Scene.hpp @@ -39,4 +39,4 @@ namespace WAL //! @brief A scene is assignable Scene &operator=(const Scene &) = default; }; -} +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/System/System.cpp b/lib/wal/sources/System/System.cpp index 56814735..0dd69f30 100644 --- a/lib/wal/sources/System/System.cpp +++ b/lib/wal/sources/System/System.cpp @@ -3,7 +3,7 @@ // #include "System.hpp" - +#include #include namespace WAL @@ -25,4 +25,4 @@ namespace WAL { return this->_dependencies; } -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/System/System.hpp b/lib/wal/sources/System/System.hpp index 5ab9b8a5..59c82c4a 100644 --- a/lib/wal/sources/System/System.hpp +++ b/lib/wal/sources/System/System.hpp @@ -5,6 +5,7 @@ #pragma once #include +#include #include "Entity/Entity.hpp" namespace WAL @@ -44,4 +45,4 @@ namespace WAL //! @brief A system can't be instantiated, it should be derived. System &operator=(const System &) = default; }; -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Wal.cpp b/lib/wal/sources/Wal.cpp index 126f78dd..2f90a19f 100644 --- a/lib/wal/sources/Wal.cpp +++ b/lib/wal/sources/Wal.cpp @@ -6,11 +6,9 @@ #include #include "Wal.hpp" -using namespace std::chrono_literals; - namespace WAL { - std::chrono::nanoseconds Wal::timestep = 8ms; + std::chrono::nanoseconds Wal::timestep = std::chrono::milliseconds(8); void Wal::_update(std::chrono::nanoseconds dtime) { @@ -47,4 +45,4 @@ namespace WAL return entity.hasComponent(dependency); }); } -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/lib/wal/sources/Wal.hpp b/lib/wal/sources/Wal.hpp index 9f560ac2..c7c02e9d 100644 --- a/lib/wal/sources/Wal.hpp +++ b/lib/wal/sources/Wal.hpp @@ -6,6 +6,7 @@ #pragma once #include +#include #include #include #include "Exception/WalError.hpp" @@ -84,7 +85,6 @@ namespace WAL if (existing == this->_systems.end()) throw NotFoundError("A system of the type \"" + std::string(type.name()) + "\" could not be found."); return *static_cast(existing->get()); - } //! @brief Remove a system using it's type. @@ -146,4 +146,4 @@ namespace WAL //! @brief A WAL can't be assigned. Wal &operator=(const Wal &) = delete; }; -} +} // namespace WAL \ No newline at end of file diff --git a/sources/Component/Movable/MovableComponent.cpp b/sources/Component/Movable/MovableComponent.cpp index 2bbbde92..4fc9bc0c 100644 --- a/sources/Component/Movable/MovableComponent.cpp +++ b/sources/Component/Movable/MovableComponent.cpp @@ -19,4 +19,4 @@ namespace BBM { this->_acceleration += force; } -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/sources/Component/Movable/MovableComponent.hpp b/sources/Component/Movable/MovableComponent.hpp index 5266232a..7656a960 100644 --- a/sources/Component/Movable/MovableComponent.hpp +++ b/sources/Component/Movable/MovableComponent.hpp @@ -36,4 +36,4 @@ namespace BBM friend class MovableSystem; }; -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/sources/Component/Position/PositionComponent.cpp b/sources/Component/Position/PositionComponent.cpp index c237f845..b1b88f43 100644 --- a/sources/Component/Position/PositionComponent.cpp +++ b/sources/Component/Position/PositionComponent.cpp @@ -40,4 +40,4 @@ namespace BBM { return this->position.z; } -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/sources/Component/Position/PositionComponent.hpp b/sources/Component/Position/PositionComponent.hpp index 368934eb..0a34a8ca 100644 --- a/sources/Component/Position/PositionComponent.hpp +++ b/sources/Component/Position/PositionComponent.hpp @@ -39,4 +39,4 @@ namespace BBM //! @brief A position component is not assignable PositionComponent &operator=(const PositionComponent &) = delete; }; -} +} // namespace WAL \ No newline at end of file diff --git a/sources/Models/Vector3.hpp b/sources/Models/Vector3.hpp index 094f6da9..81a61cf3 100644 --- a/sources/Models/Vector3.hpp +++ b/sources/Models/Vector3.hpp @@ -85,13 +85,13 @@ namespace BBM } template - Vector3 operator*(Vector3 &b) const + Vector3 operator*(const Vector3 &b) const { return Vector3(this->x * b.x, this->y * b.y, this->z * b.z); } template - Vector3 operator/=(Vector3 &b) + Vector3 operator/=(const Vector3 &b) { this->x /= b.x; this->y /= b.y; @@ -100,7 +100,7 @@ namespace BBM } template - Vector3 operator/(Vector3 &b) const + Vector3 operator/(const Vector3 &b) const { return Vector3(this->x / b.x, this->y / b.y, this->z / b.z); } @@ -157,7 +157,7 @@ namespace BBM typedef Vector3 Vector3f; typedef Vector3 Vector3u; typedef Vector3 Vector3i; -} +} // namespace WAL template std::ostream &operator<<(std::ostream &s, const BBM::Vector3 &v) diff --git a/sources/System/Movable/MovableSystem.cpp b/sources/System/Movable/MovableSystem.cpp index 2f699ece..a5048ce5 100644 --- a/sources/System/Movable/MovableSystem.cpp +++ b/sources/System/Movable/MovableSystem.cpp @@ -25,4 +25,4 @@ namespace BBM movable._velocity = movable._acceleration * WAL::Wal::timestep.count(); movable._acceleration = Vector3f(); } -} \ No newline at end of file +} // namespace WAL \ No newline at end of file diff --git a/sources/System/Movable/MovableSystem.hpp b/sources/System/Movable/MovableSystem.hpp index 08555d26..efe12bd8 100644 --- a/sources/System/Movable/MovableSystem.hpp +++ b/sources/System/Movable/MovableSystem.hpp @@ -25,4 +25,4 @@ namespace BBM //! @brief A movable system is assignable. MovableSystem &operator=(const MovableSystem &) = default; }; -} +} // namespace WAL diff --git a/tests/CallbackTest.cpp b/tests/CallbackTest.cpp index c0d43f15..534ca9f4 100644 --- a/tests/CallbackTest.cpp +++ b/tests/CallbackTest.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include "Entity/Entity.hpp" #include "Models/Callback.hpp" using namespace WAL;