refactoring

master
Vectozavr 2022-07-19 16:37:37 +07:00
parent d3fbaa0418
commit bc223e4230
8 changed files with 25 additions and 26 deletions

View File

@ -8,8 +8,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
add_executable(${CMAKE_PROJECT_NAME} add_executable(${CMAKE_PROJECT_NAME}
# game: # game:
Source.cpp Source.cpp
Player.cpp player/Player.cpp
Player.h player/Player.h
network/ShooterClient.cpp network/ShooterClient.cpp
network/ShooterClient.h network/ShooterClient.h
network/ShooterServer.cpp network/ShooterServer.cpp
@ -21,8 +21,8 @@ add_executable(${CMAKE_PROJECT_NAME}
weapon/Gun.h weapon/Gun.h
weapon/Gold_Ak47.h weapon/Gold_Ak47.h
weapon/Rifle.h weapon/Rifle.h
PlayerController.cpp player/PlayerController.cpp
PlayerController.h player/PlayerController.h
Shooter.cpp Shooter.cpp
Shooter.h Shooter.h
ShooterConsts.h ShooterConsts.h

View File

@ -6,9 +6,9 @@
#define SHOOTER_SHOOTER_H #define SHOOTER_SHOOTER_H
#include "engine/Engine.h" #include "engine/Engine.h"
#include "Player.h" #include "player/Player.h"
#include "PlayerController.h" #include "player/PlayerController.h"
#include "PlayerController.h" #include "player/PlayerController.h"
#include "engine/gui/Window.h" #include "engine/gui/Window.h"
#include "network/ShooterClient.h" #include "network/ShooterClient.h"

View File

@ -6,7 +6,7 @@
#define SHOOTER_SHOOTERCLIENT_H #define SHOOTER_SHOOTERCLIENT_H
#include "../engine/network/ClientUDP.h" #include "../engine/network/ClientUDP.h"
#include "../Player.h" #include "../player/Player.h"
class ShooterClient final : public ClientUDP { class ShooterClient final : public ClientUDP {
private: private:

View File

@ -6,7 +6,7 @@
#define SHOOTER_SHOOTERSERVER_H #define SHOOTER_SHOOTERSERVER_H
#include "../engine/network/ServerUDP.h" #include "../engine/network/ServerUDP.h"
#include "../Player.h" #include "../player/Player.h"
struct BonusInfo final { struct BonusInfo final {
const Vec3D position{}; const Vec3D position{};

View File

@ -5,9 +5,9 @@
#include "Player.h" #include "Player.h"
#include <utility> #include <utility>
#include "engine/io/Screen.h" #include "../engine/io/Screen.h"
#include "engine/utils/Log.h" #include "../engine/utils/Log.h"
#include "engine/animation/Animations.h" #include "../engine/animation/Animations.h"
Player::Player(ObjectNameTag name, const std::string &filename, const Vec3D &scale) : RigidBody(std::move(name), filename, scale) { Player::Player(ObjectNameTag name, const std::string &filename, const Vec3D &scale) : RigidBody(std::move(name), filename, scale) {
setAcceleration(Vec3D{0, -ShooterConsts::GRAVITY, 0}); setAcceleration(Vec3D{0, -ShooterConsts::GRAVITY, 0});

View File

@ -7,15 +7,15 @@
#include <SFML/Audio/Sound.hpp> #include <SFML/Audio/Sound.hpp>
#include <utility> #include <utility>
#include "engine/utils/ResourceManager.h" #include "../engine/utils/ResourceManager.h"
#include "engine/Camera.h" #include "../engine/Camera.h"
#include "engine/World.h" #include "../engine/World.h"
#include "weapon/Ak47.h" #include "../weapon/Ak47.h"
#include "weapon/Shotgun.h" #include "../weapon/Shotgun.h"
#include "weapon/Gun.h" #include "../weapon/Gun.h"
#include "weapon/Gold_Ak47.h" #include "../weapon/Gold_Ak47.h"
#include "weapon/Rifle.h" #include "../weapon/Rifle.h"
#include "ShooterConsts.h" #include "../ShooterConsts.h"
class Player final : public RigidBody { class Player final : public RigidBody {
private: private:

View File

@ -3,9 +3,8 @@
// //
#include "PlayerController.h" #include "PlayerController.h"
#include "engine/utils/Log.h" #include "../engine/utils/Log.h"
#include "ShooterConsts.h" #include "../engine/animation/Animations.h"
#include "engine/animation/Animations.h"
PlayerController::PlayerController(std::shared_ptr<Player> player, PlayerController::PlayerController(std::shared_ptr<Player> player,
std::shared_ptr<Keyboard> keyboard, std::shared_ptr<Keyboard> keyboard,

View File

@ -6,8 +6,8 @@
#define SHOOTER_PLAYERCONTROLLER_H #define SHOOTER_PLAYERCONTROLLER_H
#include "Player.h" #include "Player.h"
#include "engine/io/Keyboard.h" #include "../engine/io/Keyboard.h"
#include "engine/io/Mouse.h" #include "../engine/io/Mouse.h"
class PlayerController final { class PlayerController final {
private: private: