refactor: réorganiser les fichiers et mettre à jour les chemins d'inclusion

- Déplacer `fish.h` et `fish.cpp` vers le dossier `Entities`
- Déplacer `player.h` et `player.cpp` vers le dossier `Entities`
- Déplacer `shark.h` et `shark.cpp` vers le dossier `Entities`
- Mettre à jour les chemins d'inclusion dans les fichiers concernés
- Mettre à jour `CMakeLists.txt` pour refléter les nouveaux chemins des fichiers
This commit is contained in:
Clément Fouché
2024-12-18 13:55:24 +01:00
parent 44943caaa1
commit f0b0334ff8
7 changed files with 16 additions and 16 deletions

View File

@@ -6,8 +6,6 @@ set(CMAKE_CXX_STANDARD 23)
# Ajouter le chemin de la bibliothèque SDL2
if (WIN32)
set(CMAKE_PREFIX_PATH "C:/SDL2")
else()
set(CMAKE_PREFIX_PATH "/usr/local/lib/cmake/SDL2")
endif()
find_package(SDL2 REQUIRED)
@@ -18,13 +16,16 @@ find_package(SDL2_mixer REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS} ${SDL2_IMAGE_INCLUDE_DIRS} ${SDL2_TTF_INCLUDE_DIRS} ${SDL2_NET_INCLUDE_DIRS})
add_executable(bloubloulespoissons main.cpp fish.cpp decors.cpp
add_executable(bloubloulespoissons main.cpp
Entities/fish.cpp
Entities/fish.h
decors.cpp
camera.cpp
camera.h
env.h
env.cpp
player.h
player.cpp
Entities/player.h
Entities/player.cpp
menu.h
menu.cpp
network/networking.cpp
@@ -33,8 +34,9 @@ add_executable(bloubloulespoissons main.cpp fish.cpp decors.cpp
network/networking_client.h
display.cpp
display.h
shark.cpp
shark.h
Entities/shark.cpp
Entities/shark.h
Entities/fish.h
)
# Lier SDL2 et SDL2_image

View File

@@ -6,8 +6,8 @@
#include <iostream>
#include <string>
#include <vector>
#include "camera.h"
#include "env.h"
#include "../camera.h"
#include "../Utility/env.h"
class Fish {
private:

View File

@@ -1,10 +1,5 @@
#include "player.h"
#include <syncstream>
#include <tuple>
#include "network/networking_client.h"
#include "camera.h"
void Player::updatePlayerPos(int x, int y) {
this->x = x;
this->y = y;

View File

@@ -7,6 +7,10 @@
#include <tuple>
#include <vector>
#include "fish.h"
#include <syncstream>
#include <tuple>
#include "../network/networking_client.h"
#include "../camera.h"
enum playerData {

View File

@@ -5,8 +5,6 @@
#define sharkIMG "../img/shark.png"
#include "shark.h"
#include "network/networking.h"
Shark::Shark(const int x, const int y, const float vx, const float vy, const int id, const int width, const int height, SDL_Renderer* renderer, std::vector<Player> &players_list)
: x(x), y(y), vx(vx), vy(vy), id(id), width(width), height(height), players_list(players_list) {
SDL_Surface* sharkSurface = IMG_Load(sharkIMG);

View File

@@ -10,6 +10,7 @@
#include <SDL2/SDL.h>
#include <SDL2/SDL_mixer.h>
#include <chrono>
#include "../network/networking.h"
class Shark {
private: