54 lines
891 B
C++
54 lines
891 B
C++
#pragma once
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "Point.h"
|
|
#include "NPC.h"
|
|
|
|
struct Chest {
|
|
Point pos;
|
|
bool opened = false;
|
|
std::vector<int> itemIds;
|
|
};
|
|
|
|
struct Enemy {
|
|
Point pos;
|
|
std::string type;
|
|
int hp = 50;
|
|
};
|
|
|
|
struct Riddle {
|
|
int type = 0;
|
|
std::string text;
|
|
std::string answer;
|
|
bool isSolved = false;
|
|
};
|
|
|
|
class Location {
|
|
public:
|
|
int id = 0;
|
|
std::string title;
|
|
|
|
int width = 0;
|
|
int height = 0;
|
|
|
|
int north = 0;
|
|
int south = 0;
|
|
int west = 0;
|
|
int east = 0;
|
|
|
|
Point startPosition;
|
|
Riddle riddle;
|
|
|
|
std::vector<std::string> map;
|
|
std::vector<Chest> chests;
|
|
std::vector<Enemy> enemies;
|
|
std::vector<NPC> npcs;
|
|
|
|
bool loadFromFile(const std::string& path);
|
|
|
|
void draw(const Point& playerPosition) const;
|
|
|
|
bool isWalkable(int x, int y) const;
|
|
char getTile(int x, int y) const;
|
|
}; |