-
Notifications
You must be signed in to change notification settings - Fork 0
/
Utilities.hpp
63 lines (48 loc) · 1.56 KB
/
Utilities.hpp
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
#ifndef UTILITIES_HPP_INCLUDED
#define UTILITIES_HPP_INCLUDED
#endif // UTILITIES_HPP_INCLUDED
#include <iostream>
#include <string>
#include <SFML/Graphics.hpp>
#include <utility>
#include <map>
#pragma once
#define SZEROKOSCOKNA 3000//2800
#define WYSOKOSCOKNA 1400
#define SKOK_GR 400
#define POZIOM_GRACZ 25
#define PION_GRACZ 30
enum GameStates{Play, Closing,Uninitialized,Pause,Winner};
enum HumanStates {Stand, Fall, Jump};
enum ObjectTypes {Hero, GroundFloor,End,None,Bomba,Platforma,Dolar,BWEnemy,BFEnemy};
enum Directions {North,East,South, West};
enum Dimension {Horizontal,Vertical };
enum GameMechanisms {GetACoin, Win,Empty, WalkiIntoEnemy};
enum Letters {A,S,D,W,SPACE,ESC};
struct Collision{
sf::Vector2f nachodzenie;
ObjectTypes typ;
Collision(){typ=ObjectTypes::None;}
Collision(sf::Vector2f& a,ObjectTypes b):nachodzenie(a),typ(b){};
};
class TextureHolder{
public:
void LoadFromFile(ObjectTypes,std::string&&);
sf::Texture& GetTexture(ObjectTypes);
TextureHolder();
private:
std::map<ObjectTypes, std::unique_ptr<sf::Texture>> mapka;
};
class Observer{
public:
void SawSomething (ObjectTypes ,ObjectTypes);
GameMechanisms ReturnObserwation(){Detection=0;return stan;};
bool WasSomethingObserved(){return Detection;};
bool IsItSenseToExist(){return SenseOfLiving;}
void MarkMeAsNoNedeed(){SenseOfLiving=false;}
Observer(){SenseOfLiving=true;stan=GameMechanisms::Empty;}
private:
bool Detection=0;
bool SenseOfLiving=true;
GameMechanisms stan;
};