-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
80 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
** EPITECH PROJECT, 2022 | ||
** Bomberman | ||
** File description: | ||
** Checkable | ||
*/ | ||
|
||
#include "Checkable.hpp" | ||
|
||
namespace game | ||
{ | ||
namespace gui | ||
{ | ||
bool Checkable::update(ecs::Entity self, ecs::SystemData data, const Users::ActionEvent &event) | ||
{ | ||
if (event.action != GameAction::ACTION) | ||
return false; | ||
|
||
if (event.value == 0.f) { | ||
checked = !checked; | ||
if (onStateChanged) | ||
onStateChanged(self, checked); | ||
} | ||
return true; | ||
}; | ||
} // namespace gui | ||
} // namespace game |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
** EPITECH PROJECT, 2022 | ||
** Bomberman | ||
** File description: | ||
** IWidgetComponent | ||
*/ | ||
|
||
#ifndef GAME_GUI_IWIDGETCOMPONENT_HPP_ | ||
#define GAME_GUI_IWIDGETCOMPONENT_HPP_ | ||
|
||
#include "ecs/Component.hpp" | ||
#include "ecs/Entity.hpp" | ||
#include "ecs/System.hpp" | ||
#include "game/Users.hpp" | ||
|
||
|
||
namespace game | ||
{ | ||
namespace gui | ||
{ | ||
class IWidgetComponent : public ecs::Component { | ||
public: | ||
virtual bool update(ecs::Entity self, ecs::SystemData data, const Users::ActionEvent &event) = 0; | ||
}; | ||
} // namespace gui | ||
} // namespace game | ||
|
||
#endif /* !GAME_GUI_IWIDGETCOMPONENT_HPP_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters