2021-10-02 20:36:07 +03:00
|
|
|
//
|
|
|
|
// Created by Иван Ильин on 22.09.2021.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef SHOOTER_SHOOTER_H
|
|
|
|
#define SHOOTER_SHOOTER_H
|
|
|
|
|
2021-10-09 13:41:12 +03:00
|
|
|
#include "engine/Engine.h"
|
2021-10-02 20:36:07 +03:00
|
|
|
#include "Player.h"
|
|
|
|
#include "PlayerController.h"
|
|
|
|
#include "PlayerController.h"
|
2021-10-09 13:41:12 +03:00
|
|
|
#include "engine/gui/Window.h"
|
2021-10-02 20:36:07 +03:00
|
|
|
|
|
|
|
#include "Client.h"
|
|
|
|
#include "Server.h"
|
|
|
|
|
|
|
|
|
2021-10-12 20:18:56 +03:00
|
|
|
class Shooter final : public Engine {
|
2021-10-02 20:36:07 +03:00
|
|
|
private:
|
|
|
|
std::shared_ptr<Player> player;
|
|
|
|
std::shared_ptr<PlayerController> playerController;
|
|
|
|
|
|
|
|
sf::Sound backgroundNoise;
|
|
|
|
|
|
|
|
Window mainMenu;
|
|
|
|
|
|
|
|
std::shared_ptr<Server> server;
|
|
|
|
std::shared_ptr<Client> client;
|
|
|
|
|
|
|
|
bool inGame = false;
|
|
|
|
|
|
|
|
int fireTraces = 0;
|
|
|
|
|
|
|
|
void start() override;
|
|
|
|
void update() override;
|
|
|
|
|
|
|
|
void gui() override;
|
|
|
|
|
|
|
|
void play();
|
|
|
|
|
|
|
|
void drawPlayerStats();
|
|
|
|
void InitNetwork();
|
|
|
|
|
|
|
|
void spawnPlayer(sf::Uint16 id);
|
|
|
|
void removePlayer(sf::Uint16 id);
|
2021-10-12 17:12:47 +03:00
|
|
|
void addFireTrace(const Vec3D& from, const Vec3D& to);
|
2021-10-02 20:36:07 +03:00
|
|
|
void deleteFireTrace(const std::string& traceName);
|
2021-10-12 17:12:47 +03:00
|
|
|
void addBonus(const std::string& bonusName, const Vec3D& position);
|
2021-10-02 20:36:07 +03:00
|
|
|
void removeBonus(const std::string& bonusName);
|
|
|
|
void addWeapon(std::shared_ptr<Weapon> weapon);
|
|
|
|
void removeWeapon(std::shared_ptr<Weapon> weapon);
|
|
|
|
public:
|
|
|
|
Shooter() : mainMenu(screen, mouse) {};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //SHOOTER_SHOOTER_H
|