-
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.
Merge pull request #50 from FppEpitech/feat/link-gamedata-event-and-r…
…ender-to-engine Feat/link gamedata event and render to engine
- Loading branch information
Showing
12 changed files
with
155 additions
and
12 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
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,52 @@ | ||
/* | ||
** EPITECH PROJECT, 2024 | ||
** Zappy | ||
** File description: | ||
** GUIUpdater | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "GameDatas/GameData.hpp" | ||
|
||
#include <string> | ||
#include <memory> | ||
|
||
namespace Gui { | ||
|
||
/** | ||
* @brief GUIUpdater class | ||
* | ||
* This class is used to update the GUI GameData to ensure the GUI is up to date | ||
*/ | ||
class GUIUpdater; | ||
} | ||
|
||
class Gui::GUIUpdater { | ||
|
||
public: | ||
|
||
/** | ||
* @brief Construct a new GUIUpdater object | ||
* | ||
* @param gameData The GUI GameData to update | ||
*/ | ||
GUIUpdater(std::shared_ptr<GameData> gameData); | ||
|
||
/** | ||
* @brief Destroy the GUIUpdater object | ||
*/ | ||
~GUIUpdater() = default; | ||
|
||
/** | ||
* @brief Update the GUI GameData | ||
* | ||
* @param command The command to update the GUI GameData | ||
* @param data The data to update the GUI GameData | ||
*/ | ||
void update(const std::string &command, const std::string &data); | ||
|
||
private: | ||
|
||
std::shared_ptr<GameData> _gameData; | ||
}; |
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,16 @@ | ||
/* | ||
** EPITECH PROJECT, 2024 | ||
** Zappy | ||
** File description: | ||
** GUIUpdater | ||
*/ | ||
|
||
#include "GUIUpdater/GUIUpdater.hpp" | ||
|
||
Gui::GUIUpdater::GUIUpdater(std::shared_ptr<GameData> gameData) : _gameData(gameData) {} | ||
|
||
void Gui::GUIUpdater::update(const std::string &command, const std::string &data) | ||
{ | ||
(void)command; | ||
(void)data; | ||
} |
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,16 @@ | ||
/* | ||
** EPITECH PROJECT, 2024 | ||
** Zappy | ||
** File description: | ||
** TestEvent | ||
*/ | ||
|
||
#include "Event/Event.hpp" | ||
#include "CriterionHeaders.hpp" | ||
|
||
Test(Event, constructor, .timeout = 5) | ||
{ | ||
Gui::Event event; | ||
|
||
cr_assert_not_null(&event); | ||
} |
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,26 @@ | ||
/* | ||
** EPITECH PROJECT, 2024 | ||
** Zappy | ||
** File description: | ||
** TestGUIUpdater | ||
*/ | ||
|
||
#include "CriterionHeaders.hpp" | ||
#include "GUIUpdater/GUIUpdater.hpp" | ||
|
||
Test(GUIUpdater, constructor, .timeout = 5) | ||
{ | ||
std::shared_ptr<Gui::GameData> gameData = std::make_shared<Gui::GameData>(); | ||
Gui::GUIUpdater guiUpdater(gameData); | ||
|
||
cr_assert_not_null(&guiUpdater); | ||
} | ||
|
||
Test(GUIUpdater, update, .timeout = 5) | ||
{ | ||
std::shared_ptr<Gui::GameData> gameData = std::make_shared<Gui::GameData>(); | ||
Gui::GUIUpdater guiUpdater(gameData); | ||
|
||
guiUpdater.update("test", "test"); | ||
cr_assert_not_null(&guiUpdater); | ||
} |