From bc223e4230301e78fadf2714c750a97651167f74 Mon Sep 17 00:00:00 2001 From: Vectozavr <60608292+vectozavr@users.noreply.github.com> Date: Tue, 19 Jul 2022 16:37:37 +0700 Subject: [PATCH] refactoring --- CMakeLists.txt | 8 ++++---- Shooter.h | 6 +++--- network/ShooterClient.h | 2 +- network/ShooterServer.h | 2 +- Player.cpp => player/Player.cpp | 6 +++--- Player.h => player/Player.h | 18 +++++++++--------- .../PlayerController.cpp | 5 ++--- .../PlayerController.h | 4 ++-- 8 files changed, 25 insertions(+), 26 deletions(-) rename Player.cpp => player/Player.cpp (98%) rename Player.h => player/Player.h (92%) rename PlayerController.cpp => player/PlayerController.cpp (99%) rename PlayerController.h => player/PlayerController.h (89%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d994e4..c6f7b7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,8 +8,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") add_executable(${CMAKE_PROJECT_NAME} # game: Source.cpp - Player.cpp - Player.h + player/Player.cpp + player/Player.h network/ShooterClient.cpp network/ShooterClient.h network/ShooterServer.cpp @@ -21,8 +21,8 @@ add_executable(${CMAKE_PROJECT_NAME} weapon/Gun.h weapon/Gold_Ak47.h weapon/Rifle.h - PlayerController.cpp - PlayerController.h + player/PlayerController.cpp + player/PlayerController.h Shooter.cpp Shooter.h ShooterConsts.h diff --git a/Shooter.h b/Shooter.h index 239fb09..eadf5c6 100644 --- a/Shooter.h +++ b/Shooter.h @@ -6,9 +6,9 @@ #define SHOOTER_SHOOTER_H #include "engine/Engine.h" -#include "Player.h" -#include "PlayerController.h" -#include "PlayerController.h" +#include "player/Player.h" +#include "player/PlayerController.h" +#include "player/PlayerController.h" #include "engine/gui/Window.h" #include "network/ShooterClient.h" diff --git a/network/ShooterClient.h b/network/ShooterClient.h index 04ae2d1..b622469 100644 --- a/network/ShooterClient.h +++ b/network/ShooterClient.h @@ -6,7 +6,7 @@ #define SHOOTER_SHOOTERCLIENT_H #include "../engine/network/ClientUDP.h" -#include "../Player.h" +#include "../player/Player.h" class ShooterClient final : public ClientUDP { private: diff --git a/network/ShooterServer.h b/network/ShooterServer.h index 1761992..6034b96 100644 --- a/network/ShooterServer.h +++ b/network/ShooterServer.h @@ -6,7 +6,7 @@ #define SHOOTER_SHOOTERSERVER_H #include "../engine/network/ServerUDP.h" -#include "../Player.h" +#include "../player/Player.h" struct BonusInfo final { const Vec3D position{}; diff --git a/Player.cpp b/player/Player.cpp similarity index 98% rename from Player.cpp rename to player/Player.cpp index 99cf62a..4a008c0 100644 --- a/Player.cpp +++ b/player/Player.cpp @@ -5,9 +5,9 @@ #include "Player.h" #include -#include "engine/io/Screen.h" -#include "engine/utils/Log.h" -#include "engine/animation/Animations.h" +#include "../engine/io/Screen.h" +#include "../engine/utils/Log.h" +#include "../engine/animation/Animations.h" Player::Player(ObjectNameTag name, const std::string &filename, const Vec3D &scale) : RigidBody(std::move(name), filename, scale) { setAcceleration(Vec3D{0, -ShooterConsts::GRAVITY, 0}); diff --git a/Player.h b/player/Player.h similarity index 92% rename from Player.h rename to player/Player.h index d1d9486..36e97e0 100644 --- a/Player.h +++ b/player/Player.h @@ -7,15 +7,15 @@ #include #include -#include "engine/utils/ResourceManager.h" -#include "engine/Camera.h" -#include "engine/World.h" -#include "weapon/Ak47.h" -#include "weapon/Shotgun.h" -#include "weapon/Gun.h" -#include "weapon/Gold_Ak47.h" -#include "weapon/Rifle.h" -#include "ShooterConsts.h" +#include "../engine/utils/ResourceManager.h" +#include "../engine/Camera.h" +#include "../engine/World.h" +#include "../weapon/Ak47.h" +#include "../weapon/Shotgun.h" +#include "../weapon/Gun.h" +#include "../weapon/Gold_Ak47.h" +#include "../weapon/Rifle.h" +#include "../ShooterConsts.h" class Player final : public RigidBody { private: diff --git a/PlayerController.cpp b/player/PlayerController.cpp similarity index 99% rename from PlayerController.cpp rename to player/PlayerController.cpp index f7c802c..f3fde49 100644 --- a/PlayerController.cpp +++ b/player/PlayerController.cpp @@ -3,9 +3,8 @@ // #include "PlayerController.h" -#include "engine/utils/Log.h" -#include "ShooterConsts.h" -#include "engine/animation/Animations.h" +#include "../engine/utils/Log.h" +#include "../engine/animation/Animations.h" PlayerController::PlayerController(std::shared_ptr player, std::shared_ptr keyboard, diff --git a/PlayerController.h b/player/PlayerController.h similarity index 89% rename from PlayerController.h rename to player/PlayerController.h index 13b36e0..97639d0 100644 --- a/PlayerController.h +++ b/player/PlayerController.h @@ -6,8 +6,8 @@ #define SHOOTER_PLAYERCONTROLLER_H #include "Player.h" -#include "engine/io/Keyboard.h" -#include "engine/io/Mouse.h" +#include "../engine/io/Keyboard.h" +#include "../engine/io/Mouse.h" class PlayerController final { private: