From a556b45abf18f1bd509daaf63b66b7d55e9fd291 Mon Sep 17 00:00:00 2001 From: jjesswan Date: Mon, 22 Apr 2024 21:56:26 -0400 Subject: add engine version --- engine-ocean/Game/Components/DrawComponent.cpp | 54 ++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 engine-ocean/Game/Components/DrawComponent.cpp (limited to 'engine-ocean/Game/Components/DrawComponent.cpp') diff --git a/engine-ocean/Game/Components/DrawComponent.cpp b/engine-ocean/Game/Components/DrawComponent.cpp new file mode 100644 index 0000000..28640dd --- /dev/null +++ b/engine-ocean/Game/Components/DrawComponent.cpp @@ -0,0 +1,54 @@ +#include "drawcomponent.h" +#include + +DrawComponent::DrawComponent(std::shared_ptr shape, std::string shape_name) +{ + m_shape = shape; + m_shape_name = shape_name; +} + +DrawComponent::DrawComponent(std::shared_ptr shape) +{ + m_shape = shape; +} + +DrawComponent::DrawComponent(std::vector> shapes) +{ + m_shapes = shapes; + hasMultipleShapes = true; +} + + +void DrawComponent::addMaterial(std::string material_name, std::string material_filepath){ + Global::graphics.addMaterial(material_name, material_filepath); + m_material_name = material_name; + hasMaterial = true; +} + +std::shared_ptr DrawComponent::getShape(){ + return m_shape; +} + +std::vector> DrawComponent::getShapesWithMaterials(){ + if (hasMultipleShapes){ + return m_shapes; + } +} + +std::string DrawComponent::getShapeName(){ + return m_shape_name; +} + +std::shared_ptr DrawComponent::getMaterial(){ + return Global::graphics.getMaterial(m_material_name); +} + +bool DrawComponent::objHasMaterial(){ + return hasMaterial; +} + +bool DrawComponent::objHasMultipleShapes(){ + return hasMultipleShapes; +} + + -- cgit v1.2.3-70-g09d2