remove IController

This commit is contained in:
arthur.jamet
2021-05-21 09:43:01 +02:00
parent 246aed16cd
commit 125bad49f1
3 changed files with 8 additions and 48 deletions
+1 -2
View File
@@ -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
+7 -8
View File
@@ -10,13 +10,12 @@
#include <raylib.h>
#include <vector>
#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);
@@ -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<GamePad::Button> getPressedButtons(void) = 0;
virtual ~IController() = default;
};
}