-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHeader.h
More file actions
82 lines (76 loc) · 2.08 KB
/
Copy pathHeader.h
File metadata and controls
82 lines (76 loc) · 2.08 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
#pragma once
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
//#include <SFML/>
#define PI 3.14159265
extern const int distanceAttackingObject;
namespace UtilitiesGame
{
struct TextureData
{
sf::Image* image{ nullptr };
sf::Texture* texture{ nullptr };
sf::Sprite* sprite{ nullptr };
int maxFrameX{ 1 };
int maxFrameY{ 1 };
//TextureData(const TextureData& texDat){}
TextureData()
{
}
/*TextureData(const TextureData& var) // îñòàâèòü óòå÷êè ïàìÿòè - õîðîøàÿ èäåÿ?- íåò, íî âðåìåíè ìàëî
{
this->image = new sf::Image;
this->texture = new sf::Texture;
this->sprite = new sf::Sprite;
*this->image = *var.image;
*this->texture = *var.texture;
*this->sprite = *var.sprite;
}
~TextureData()
{
delete sprite;
delete texture;
delete image;
}*/
};
struct SizeXY
{
SizeXY(int sizeX = 0, int sizeY = 0) { this->sizeX = sizeX; this->sizeY = sizeY; };
int sizeX;
int sizeY;
SizeXY& operator=(const SizeXY& right)
{
sizeX = right.sizeX;
sizeY = right.sizeY;
return *this;
}
};
struct SpeedXY
{
double x;
double y;
SpeedXY(const double x = 0, const double y = 0) { this->x = x; this->y = y; };
SpeedXY(const SpeedXY& speedXY) { this->x = speedXY.x; this->y = speedXY.y; };
};
struct XY
{
int x, y;
XY(int x = 0, int y = 0) { this->x = x, this->y = y; };
};
struct Stats
{
double speed, attackTime, attackRange, attackSpeed;
int maxHealthPoints, healthPoints;
Stats(double speed = 0, double attackTime = 0, double attackRange = 0, double attackSpeed = 0, int maxHealthPoints = 0, int healthPoints = 0)
{
this->speed = speed; this->attackTime = attackTime; this->attackRange = attackRange;
this->attackSpeed = attackSpeed; this->maxHealthPoints = maxHealthPoints; this->healthPoints = healthPoints;
};
Stats& operator=(const Stats& stats)
{
this->speed = stats.speed; this->attackTime = stats.attackTime; this->attackRange = stats.attackRange;
this->attackSpeed = stats.attackSpeed; this->maxHealthPoints = stats.maxHealthPoints; this->healthPoints = stats.healthPoints;
return *this;
}
};
}