52 lines
1.2 KiB
C++
52 lines
1.2 KiB
C++
#pragma once
|
|
#include "Board.hpp"
|
|
#include "Player.hpp"
|
|
#include <SFML/Graphics/View.hpp>
|
|
#include <vector>
|
|
#include <SFML/Audio/Music.hpp>
|
|
#include <SFML/Graphics.hpp>
|
|
#include <SFML/System/Sleep.hpp>
|
|
#include <SFML/System/Time.hpp>
|
|
#include <SFML/Window/Event.hpp>
|
|
|
|
class Engine {
|
|
public:
|
|
Engine();
|
|
|
|
// Przygotowanie zmiennych
|
|
void addPlayer(const std::string& name, unsigned int seed, short color);
|
|
void initializeGame();
|
|
|
|
// Pętla gry
|
|
void startGame(Board board);
|
|
bool isGameOver() const;
|
|
|
|
// Logika gry
|
|
void nextTurn();
|
|
int rollDice(unsigned int seed, unsigned int moveNumber);
|
|
short spawnPiece(short color, short pawnId);
|
|
short takePawns(short color, short field);
|
|
bool movePiece(short color, short field, short steps);
|
|
|
|
// Audio
|
|
bool dicerollLoaded = true;
|
|
bool pawnmoveLoaded = true;
|
|
bool tadaLoaded = true;
|
|
sf::Music dicerollBuffer;
|
|
sf::Music pawnmoveBuffer;
|
|
sf::Music tadaBuffer;
|
|
|
|
// Pomocnicze
|
|
std::string winnerNickname = "";
|
|
unsigned int turnCounter = 0;
|
|
|
|
// Z Game
|
|
Board board;
|
|
|
|
private:
|
|
std::vector<Player> players;
|
|
short currentPlayerIndex;
|
|
|
|
// Pomocnicze
|
|
void announceWinner(const Player& player) const;
|
|
}; |