aboutsummaryrefslogtreecommitdiff
path: root/frontend/GameData.h
blob: 172f7d5df7b45f5bde2c5f6b80a34c38f736e2ef (plain)
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
#pragma once

#include "DB.h"

class Enemy;
class Object;
class Location;

class GameData {
public:
	static GameData & get_instance();

private:
	DB db { "kerkersendraken.db" };

public:
	Enemy * create_enemy(const std::string & name) const;
	Object * create_object(const std::string & name) const;
	Location * create_location(const std::string & name) const;

public:
	void leaderbord_add(const std::string & name, unsigned int gold);
	void leaderbord_print() const;

public:
	std::vector<std::string> random_objects(unsigned count = 1) const;
	std::vector<std::string> random_locations(unsigned count = 1) const;
	std::vector<std::string> random_enemies(unsigned count = 1) const;
	std::string random_object() const;
	std::string random_location() const;
	std::string random_enemy() const;

private:
	std::vector<std::string> random_names(const std::string & table, unsigned count) const;
};