-
Notifications
You must be signed in to change notification settings - Fork 1
/
Maps.h
65 lines (50 loc) · 1.52 KB
/
Maps.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
#pragma once
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <cstdlib>
#include "Tile.h"
#include "MapObject.h"
#include "GameNonActiveObject.h"
#include "GameActiveObject.h"
#include "Enemies/Enemy.h"
#ifndef MAPS_H
#define MAPS_H
#include <sstream>
class Maps{
private:
int clockCounter;
int Size;
unsigned int numberOfObjects;
std::map<const int, std::string> addresses;
std::map<const int, std::string> addressesOfActiveGraphics;
Tile ** map_data;
std::vector <GameNonActiveObject *> mapGameObjects;
std::vector <GameActiveObject*> mapGameActiveObjects;
int ** arrayOfFieldsOccupiedWithObjects;
std::vector <sf::Vector3i> listOfEnemies;
std::map <int, int> typeOfTileAnimations;
std::map <int, sf::Image> mapGraphics;
std::map <int, sf::Sprite> tileSprites;
public:
Maps(const std::string& filename);
~Maps();
void showMap(sf::RenderWindow *window, sf::Vector2f heroPosition);
int getSize();
int getNoOfObjects();
std::vector <GameNonActiveObject *> getMapGameObjects();
std::vector <GameActiveObject *> getMapActiveGameObjects();
std::vector<sf::Vector3i> GetListOfEnemies();
private:
void MapFileLoading(const std::string& filename);
void MapFileLoading_GetMapSize(std::ifstream& inputMapFileStream);
void MapFileLoading_PrepareTileArrayAccordingToSize();
void MapFileLoading_GetEnemies(std::ifstream& inputMapFileStream);
void MapFileLoading_SkipFileLine(std::ifstream& inputMapFileStream);
void Animate();
void CreateTiles();
};
#endif