-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInterface.hpp
67 lines (54 loc) · 1.98 KB
/
Interface.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
64
65
66
67
#ifndef INTERFACE_HPP_INCLUDED
#define INTERFACE_HPP_INCLUDED
#endif // INTERFACE_HPP_INCLUDED
#include <iostream>
#include <utility>
#include <memory>
#include "Utilities.hpp"
#include "Units.hpp"
#include "Commands.hpp"
#include "SFML/Graphics.hpp"
#include "ActiveUnits.hpp"
#include "PassiveUnits.hpp"
#include "Batch.hpp"
#pragma once
class Interface{
public:
void AutomaticMove(sf::Time& dt);
void DetectCollisions();
void DistributeCommands(CommandQueue& , sf::Time& );
std::vector<std::shared_ptr<Observer>>& LookForObservations();
void TakeBackObservator(std::vector<std::shared_ptr<Observer>>&& );
void DeleteNoNeededObservators();
void update();
void draw(sf::RenderWindow& );
void RespNewObjects(TextureHolder& );
Interface( std::unique_ptr<Batch>&& );
Interface()=default;
void TakeBatch(std::unique_ptr<Batch>&& );
public:
int Increment_Observers_IteratorPosition();//-1 jesli blad, w innym wypadku inkremenuje
GameMechanisms&& ReturnMechanismFromTheObserwver();
void StartSearchingForMechanics();
bool IsEnd(){if (it1==_Observers.end())return 0; return 1;}
private:
void MustBeDetectedFirst();
void DetectFindings();
void DetectBullets();
void DetectSpecialPoints();
void DetectFirstPlan();
void DetectMonsters();
void AutomaticFiring(TextureHolder&);
private:
std::unique_ptr<Entity> _Hero;
std::vector<std::unique_ptr<Entity>> _Monsters;
std::vector<std::unique_ptr<Entity>> _Bullets;
std::vector<std::unique_ptr<Entity>> _Findings;
std::vector<std::shared_ptr<Entity>> _FirstPlan;
std::vector<std::shared_ptr<Entity>> _SpecialPoints;
std::vector<std::unique_ptr<Entity>> _SecondPlan;
std::vector<std::shared_ptr<Observer>> _Observers;
std::vector<std::shared_ptr<Observer>>::iterator it1;
std::vector<std::unique_ptr<Entity>>::iterator it2;
std::vector<std::shared_ptr<Entity>>::iterator it3;
};