-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtryb.h
58 lines (47 loc) · 1.32 KB
/
tryb.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef TRYB_H
#define TRYB_H
#include <cstdint>
#include <vector>
#include <QObject>
#include "plansza.h"
#include "ruch.h"
class Tryb : public QObject
{
Q_OBJECT
public:
Tryb();
~Tryb();
enum TYPGRACZA { CZLOWIEK, KOMPUTER, EDYTOR };
void physicalMove( int pionekId, int pozycja );
void move( ruch r );
virtual bool isValidMove( int pionekId, int pos ) = 0;
virtual std::vector <int> findValidMoves( int pionekId ) = 0;
virtual TYPGRACZA dajTypGracza( int graczId ) = 0; //czemu to nie moze byc virtualne?
virtual void turaStart() = 0;
Plansza plansza;
int historyIterator;
std::vector < ruch > history;
//protected:
TYPGRACZA typGracza[2];
int podanWTurze;
int przesuniecWTurze;
Plansza planszaPoczatkowa;
virtual Plansza dajPlanszePoczatkowa() = 0;
public slots:
virtual void zatwierdz() = 0;
virtual void move( int pionekId, int pozycja ) = 0;
virtual void moveDetector(int pionekId , int pozycja) = 0;
virtual bool undo() = 0;
virtual bool redo() = 0;
signals:
void moved( int pionekId, int pos );
void nowaTura( int gracz );
void winDetector( int gracz );
void uwaga( QString tresc );
void wykonaneRuchy( int przesuniecWTurze, int podanWTurze );
void undoAble( bool );
void redoAble( bool );
void zmianaTrybu( Tryb* nowy ); //uzywane tylko przez tryb edycji
void graczUpdate( int );
};
#endif // TRYB_H