mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-02 18:21:12 +00:00
adding a RectangleDrawable2DComponent and moving files
This commit is contained in:
+2
-2
@@ -10,7 +10,7 @@ add_subdirectory(${PROJECT_SOURCE_DIR}/lib/wal)
|
||||
add_subdirectory(${PROJECT_SOURCE_DIR}/lib/Ray)
|
||||
|
||||
add_executable(bomberman
|
||||
sources/main.cpp
|
||||
)
|
||||
sources/main.cpp
|
||||
sources/Component/Drawable/RectangleDrawable2DComponent.cpp sources/Component/Drawable/RectangleDrawable2DComponent.hpp)
|
||||
|
||||
target_link_libraries(bomberman wal ray)
|
||||
@@ -13,7 +13,6 @@ RAY::Drawables::Drawables3D::Circle::Circle(const Vector3 ¢erPosition, int r
|
||||
|
||||
}
|
||||
|
||||
|
||||
int RAY::Drawables::Drawables3D::Circle::getRadius(void) const
|
||||
{
|
||||
return this->_radius;
|
||||
@@ -34,4 +33,4 @@ void RAY::Drawables::Drawables3D::Circle::drawOn(RAY::Window &)
|
||||
{
|
||||
DrawCircle3D(this->_centerPos, this->_radius,this->_rotationAxis,
|
||||
this->_rotationAngle, this->_color);
|
||||
}
|
||||
}
|
||||
@@ -15,11 +15,7 @@ add_library(wal
|
||||
sources/Exception/WalError.hpp
|
||||
sources/Entity/Entity.cpp
|
||||
sources/Component/Component.cpp
|
||||
sources/Component/Position/PositionComponent.cpp
|
||||
sources/Component/Position/PositionComponent.hpp
|
||||
sources/Models/Vector3.hpp
|
||||
sources/Component/Movable/MovableComponent.cpp
|
||||
sources/Component/Movable/MovableComponent.hpp
|
||||
sources/System/Movable/MovableSystem.cpp
|
||||
sources/System/Movable/MovableSystem.hpp
|
||||
sources/System/System.cpp
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// Created by cbihan on 24/05/2021.
|
||||
//
|
||||
|
||||
#include "Drawable2DComponent.hpp"
|
||||
|
||||
namespace BBM
|
||||
{
|
||||
Drawable2DComponent::Drawable2DComponent(WAL::Entity &entity)
|
||||
: Component(entity)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// Created by cbihan on 24/05/2021.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Component/Component.hpp"
|
||||
#include "Drawables/ADrawable2D.hpp"
|
||||
#include "Color.hpp"
|
||||
|
||||
namespace BBM
|
||||
{
|
||||
class Drawable2DComponent : public WAL::Component
|
||||
{
|
||||
public:
|
||||
//! @brief color of the drawable
|
||||
RAY::Color color;
|
||||
//! @brief The rotation (clock wise)
|
||||
int rotation;
|
||||
|
||||
explicit Drawable2DComponent(WAL::Entity &entity);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// Created by cbihan on 24/05/2021.
|
||||
//
|
||||
|
||||
#include "RectangleDrawable2DComponent.hpp"
|
||||
#include "Drawable2DComponent.hpp"
|
||||
|
||||
namespace BBM
|
||||
{
|
||||
|
||||
RectangleDrawableComponent::RectangleDrawableComponent(WAL::Entity &entity)
|
||||
: Drawable2DComponent(entity)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// Created by cbihan on 24/05/2021.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Drawable2DComponent.hpp"
|
||||
#include "Entity/Entity.hpp"
|
||||
|
||||
namespace BBM
|
||||
{
|
||||
class RectangleDrawableComponent : public Drawable2DComponent
|
||||
{
|
||||
public:
|
||||
//! @brief The length of the rectangle
|
||||
unsigned int length;
|
||||
//! @brief The width of the rectangle
|
||||
unsigned int width;
|
||||
|
||||
explicit RectangleDrawableComponent(WAL::Entity &entity);
|
||||
RectangleDrawableComponent(const RectangleDrawableComponent &) = default;
|
||||
~RectangleDrawableComponent() override = default;
|
||||
RectangleDrawableComponent &operator=(const RectangleDrawableComponent &) = delete;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
SetTraceLogLevel(LOG_WARNING);
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
const int screenWidth = 800;
|
||||
|
||||
Reference in New Issue
Block a user