-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge: Merge pull request #9 from G-Epitech/7-project-folder-architec…
…ture Project folder architecture
- Loading branch information
Showing
52 changed files
with
1,651 additions
and
37 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,8 +1,18 @@ | ||
cmake_minimum_required(VERSION 3.27) | ||
project(arcade) | ||
|
||
set(ARCADE_BIN_DIR ${CMAKE_CURRENT_LIST_DIR}) | ||
set(ARCADE_LIB_DIR ${CMAKE_CURRENT_LIST_DIR}/lib) | ||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20") | ||
|
||
add_subdirectory(src) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ARCADE_BIN_DIR}) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ARCADE_LIB_DIR}) | ||
set(CMAKE_SHARED_LIBRARY_PREFIX "arcade_") | ||
|
||
add_subdirectory(core) | ||
add_subdirectory(games) | ||
add_subdirectory(graphics) | ||
|
||
target_include_directories (arcade PUBLIC ${CMAKE_CURRENT_LIST_DIR}/common/) |
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
Submodule common
deleted from
740723
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,11 @@ | ||
# 📦 Arcade Shared Library | ||
Shared library for Arcade project | ||
|
||
## Description | ||
This library contains shared code for the Arcade project in order to unify interfaces between collaborative groups. | ||
|
||
## Groups | ||
- **[G-Epitech](https://github.com/G-Epitech/FMY-Arcade)** : [Flavien Chenu](https://github.com/flavien-chenu), [Math](https://github.com/tekmath) & [Yann Masson](https://github.com/Yann-Masson) | ||
|
||
- **[Carapace Retro](https://github.com/G-Epitech)** : [Baptiste Moreau](https://github.com/BxptisteM), [Axel Fradet](https://github.com/AxelF44) & [Suceveanu Dragos](https://github.com/sdragos1) | ||
|
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 | ||
** arcade-shared | ||
** File description: | ||
** IEntity | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <map> | ||
#include <memory> | ||
|
||
#include "../types/UUId.hpp" | ||
|
||
namespace shared::games | ||
{ | ||
class IGame; | ||
|
||
namespace entity | ||
{ | ||
class IEntity; | ||
|
||
typedef std::map<types::UUId, std::shared_ptr<IEntity>> EntitiesMap; | ||
} | ||
|
||
namespace components | ||
{ | ||
class IComponent; | ||
|
||
typedef std::map<types::UUId, std::shared_ptr<IComponent>> ComponentsMap; | ||
} | ||
} | ||
|
||
class shared::games::entity::IEntity | ||
{ | ||
public: | ||
virtual ~IEntity() = default; | ||
|
||
/** | ||
* @brief Get the id of the entity | ||
* | ||
* @return Entity unique id | ||
*/ | ||
virtual const types::UUId &getId(void) const noexcept = 0; | ||
|
||
/** | ||
* @brief Get the components of the entity | ||
* | ||
* @return Components of the entity | ||
*/ | ||
virtual const components::ComponentsMap &getComponents(void) const noexcept = 0; | ||
}; |
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,68 @@ | ||
/* | ||
** EPITECH PROJECT, 2024 | ||
** shared-arcade | ||
** File description: | ||
** IGame | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <memory> | ||
#include "IEntity.hpp" | ||
#include "../types/types.hpp" | ||
#include "types/GameManifest.hpp" | ||
|
||
using namespace shared::types; | ||
|
||
namespace shared::games | ||
{ | ||
class IGame; | ||
|
||
typedef unsigned long DeltaTime; | ||
} | ||
|
||
class shared::games::IGame | ||
{ | ||
public: | ||
virtual ~IGame() = default; | ||
|
||
/** | ||
* @brief Compute the game each tick of the program | ||
* | ||
* @param dt Time since last tick (Time in `milliseconds`) | ||
*/ | ||
virtual void compute(DeltaTime dt) = 0; | ||
|
||
/** | ||
* @brief Manifest with informations of the game | ||
* | ||
*/ | ||
virtual const GameManifest &getManifest(void) const noexcept = 0; | ||
|
||
/** | ||
* @brief The minimum window size required for the game (pixels) | ||
* | ||
*/ | ||
virtual const Vector2u getWindowMinSize(void) const noexcept = 0; | ||
|
||
/** | ||
* @brief Number of tiles that represent the game | ||
* Tile size is managed by the renderer | ||
* | ||
*/ | ||
virtual const Vector2u getSize(void) const noexcept = 0; | ||
|
||
/** | ||
* @brief Get map of entities | ||
* | ||
*/ | ||
virtual const entity::EntitiesMap &getEntities(void) const = 0; | ||
|
||
/** | ||
* @brief Get entity by id | ||
* | ||
* @param id Id of the entity | ||
* @return The specific entity | ||
*/ | ||
virtual std::shared_ptr<entity::IEntity> getEntityById(const UUId &id) const = 0; | ||
}; |
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,36 @@ | ||
/* | ||
** EPITECH PROJECT, 2024 | ||
** arcade-shared | ||
** File description: | ||
** IGameProvider | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <memory> | ||
#include "IGame.hpp" | ||
#include "types/GameManifest.hpp" | ||
|
||
namespace shared::games { | ||
class IGameProvider; | ||
} | ||
|
||
class shared::games::IGameProvider | ||
{ | ||
public: | ||
virtual ~IGameProvider() = default; | ||
|
||
/** | ||
* @brief Provides the game manifest | ||
* | ||
* @return Manifest of current game | ||
*/ | ||
virtual const GameManifest &getManifest() const noexcept = 0; | ||
|
||
/** | ||
* @brief Provides a new instance of the game | ||
* | ||
* @return Created game instance | ||
*/ | ||
virtual std::shared_ptr<game::IGame> createInstance(void) = 0; | ||
}; |
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,29 @@ | ||
/* | ||
** EPITECH PROJECT, 2024 | ||
** arcade-shared | ||
** File description: | ||
** ICollidableComponent | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "../IGame.hpp" | ||
#include "IPositionComponent.hpp" | ||
#include "../../types/Vector.hpp" | ||
|
||
namespace shared::games::components { | ||
class ICollidableComponent; | ||
} | ||
|
||
class shared::games::components::ICollidableComponent: public virtual IPositionComponent | ||
{ | ||
public: | ||
virtual ~ICollidableComponent() = default; | ||
|
||
/** | ||
* @brief On collide event handler for the component | ||
* @param ctx Context of the game | ||
* @param target Target entity | ||
*/ | ||
virtual void onCollide(std::shared_ptr<IGame> &ctx, std::shared_ptr<ICollidableComponent> target) = 0; | ||
}; |
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,49 @@ | ||
/* | ||
** EPITECH PROJECT, 2024 | ||
** arcade-shared | ||
** File description: | ||
** IComponent | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "../IEntity.hpp" | ||
#include "../../types/UUId.hpp" | ||
|
||
namespace shared::games::components { | ||
typedef enum { | ||
DISPLAYABLE, | ||
SOUND, | ||
COLLIDABLE, | ||
POSITION, | ||
KEYBOARD | ||
} ComponentType; | ||
|
||
class IComponent; | ||
} | ||
|
||
class shared::games::components::IComponent { | ||
public: | ||
virtual ~IComponent() = default; | ||
|
||
/** | ||
* @brief Get the type of the component | ||
* | ||
* @return Type of the component | ||
*/ | ||
virtual const ComponentType getType() const noexcept = 0; | ||
|
||
/** | ||
* @brief Get the uuid of component | ||
* | ||
* @return Component id | ||
*/ | ||
virtual const types::UUId &getId() const noexcept = 0; | ||
|
||
/** | ||
* @brief Get the parent entity of the component | ||
* | ||
* @return Entity of the component | ||
*/ | ||
virtual std::shared_ptr<entity::IEntity> getEntity() noexcept = 0; | ||
}; |
Oops, something went wrong.