From 125bad49f15a9252cbc8fd3c0fb205712484d3a1 Mon Sep 17 00:00:00 2001 From: "arthur.jamet" Date: Fri, 21 May 2021 09:43:01 +0200 Subject: [PATCH] remove IController --- lib/Ray/CMakeLists.txt | 3 +- lib/Ray/include/Controllers/Gamepad.hpp | 15 ++++---- lib/Ray/include/Controllers/IController.hpp | 38 --------------------- 3 files changed, 8 insertions(+), 48 deletions(-) delete mode 100644 lib/Ray/include/Controllers/IController.hpp diff --git a/lib/Ray/CMakeLists.txt b/lib/Ray/CMakeLists.txt index ba6da76f..a8d8d007 100644 --- a/lib/Ray/CMakeLists.txt +++ b/lib/Ray/CMakeLists.txt @@ -52,8 +52,7 @@ set(HEADERS include/Drawables/3D/Ray.hpp include/Drawables/3D/Sphere.hpp include/Drawables/3D/Triangle.hpp -include/Controllers/IController.hpp - ) +) set(SRC src/Audio/Music.cpp diff --git a/lib/Ray/include/Controllers/Gamepad.hpp b/lib/Ray/include/Controllers/Gamepad.hpp index 27c6676a..b6a27b81 100644 --- a/lib/Ray/include/Controllers/Gamepad.hpp +++ b/lib/Ray/include/Controllers/Gamepad.hpp @@ -10,13 +10,12 @@ #include #include -#include "IController.hpp" namespace RAY ::Controller { //! @brief Entity representing a gamepad controller - class GamePad : public IController { + class GamePad { public: typedef ::GamepadButton Button; @@ -25,7 +24,7 @@ namespace RAY GamePad(int id); //! @brief A default destructor - ~GamePad() = override default; + ~GamePad() = default; //! @brief A default copy constructor GamePad(const GamePad &) = default; @@ -36,22 +35,22 @@ namespace RAY //! @brief Returns true if Button is pressed on the gamepad //! @param Button The keycode of the button - bool isPressed(Button) override; + bool isPressed(Button); //! @brief Returns true if Button is down on the gamepad //! @param Button The keycode of the button - bool isDown(Button) override; + bool isDown(Button); //! @brief Returns true if Button is released on the gamepad //! @param Button The keycode of the button - bool isReleased(Button) override; + bool isReleased(Button); //! @brief Returns true if Button is up on the gamepad //! @param Button The keycode of the button - bool isUp(Button) override; + bool isUp(Button); //! @brief Returns true if controller is available - bool isAvailable() override; + bool isAvailable(); //! @brief Sets gamepad's id void setID(int id); diff --git a/lib/Ray/include/Controllers/IController.hpp b/lib/Ray/include/Controllers/IController.hpp deleted file mode 100644 index 01290173..00000000 --- a/lib/Ray/include/Controllers/IController.hpp +++ /dev/null @@ -1,38 +0,0 @@ -// -// Created by cbihan on 17/05/2021. -// - -#pragma once - - -namespace RAY -{ - class IController - { - public: - //! @brief Returns true if Button is pressed on the gamepad - //! @param Button The keycode of the button - virtual bool isPressed(Button) = 0; - - //! @brief Returns true if Button is down on the gamepad - //! @param Button The keycode of the button - virtual bool isDown(Button) = 0; - - //! @brief Returns true if Button is released on the gamepad - //! @param Button The keycode of the button - virtual bool isReleased(Button) = 0; - - //! @brief Returns true if Button is up on the gamepad - //! @param Button The keycode of the button - virtual bool isUp(Button) = 0; - - //! @brief Returns true if controller is available - virtual bool isAvailable(Button) = 0; - - //! @brief Fetch currently pressed buttons - //! @return Returns a vector containing keycode of currently pressed buttons - virtual std::vector getPressedButtons(void) = 0; - - virtual ~IController() = default; - }; -} \ No newline at end of file