Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include <SFML/Graphics.hpp>
- #include <SFML/Network.hpp>
- #include "Enums.hpp"
- #include "Player.hpp"
- #include "Bullet.hpp"
- #include "Collision.hpp"
- #include <iostream>
- class Multiplayer
- {
- public:
- Multiplayer(sf::RenderWindow&, Gamestate&, sf::Vector2f&, bool);
- ~Multiplayer();
- void runServer();
- void connectToServer();
- sf::Vector2f normalizeMousePosition();
- void start();
- void processEvents();
- void update();
- void draw();
- private:
- sf::Vector2f playableArea;
- sf::RenderWindow *mainWindow;
- sf::RenderTexture *gameTexture;
- sf::View *gameView;
- Gamestate *gamestate;
- sf::TcpListener listener;
- sf::TcpSocket socket;
- sf::Packet packetPosition, packetBullet;
- sf::Clock gameClock;
- sf::Time gameTime;
- Player *player1, *player2;
- std::vector<Bullet> bullets_p1, bullets_p2;
- Collision *collision;
- bool focus;
- std::string connectedString, title;
- unsigned bulletsCount;
- const unsigned maxBullets;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement