-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstruct.h
69 lines (64 loc) · 1.57 KB
/
struct.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
59
60
61
62
63
64
65
66
67
68
69
#pragma once
#define windowWidth 1024
#define windowHeight 1024
#define boxWidth 128
#define boxHeight 128
#include <iostream>
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <math.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <SFML/Graphics/Sprite.hpp>
#include "figury.h"
using namespace sf;
using namespace std;
struct boardstate{
public:
char tab[8][9]={
"wsgkqgsw",
"pppppppp",
"00000000",
"00000000",
"00000000",
"00000000",
"PPPPPPPP",
"WSGKQGSW"
};
char checkpiece(Vector2i v);
void reset();
void drawmoves(RenderWindow& window);
void clear();
void ruch(Vector2i f,Vector2i t);
};
boardstate moves(Vector2i v, boardstate board,int initialstate);
Vector2f to_vector2f(Vector2i v);
Vector2i to_vector2i(Vector2f v);
class kwadrat{
sf::RectangleShape box;
public:
kwadrat(Vector2f v,int c);
void draw(RenderWindow& window);
void move(Vector2f v);
};
class plansza{
vector<kwadrat> tab;
vector<Figura> figtab;
int postab[8][8];
public:
boardstate actualboardstate;
plansza();
int return_state(Vector2i v);
void change_state(Vector2i v,int n);
void printtab();
void draw(RenderWindow& window);
void figdraw(RenderWindow& window);
char checkpiece(Vector2i v);
bool ruch(Vector2i f, Vector2i t,RenderWindow& window);
int szach();
int mat=0;
};
void write_text(RenderWindow& okno,string tekst,Vector2f pos);