summaryrefslogtreecommitdiff
path: root/kurator/src/SceneBuilder.cpp
blob: f3c05a5524dfd547e091ee474189cd0ee404ed8f (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
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
68
69
70
71
72
73
#include "SceneBuilder.h"

#include <memory>
#include <ostream>
#include <string_view>
#include <utility>

#include "Battle.h"
#include "Campaign.h"
#include "ScenarioEditor.h"
#include "Scene.h"
#include "Title.h"


namespace kurator
{


SceneBuilder::SceneBuilder(std::shared_ptr<Session> _session) :
	session {std::move(_session)}
{
}


void
SceneBuilder::list_scenes(std::ostream& out)
{
	out << "Battle\n" "Campaign\n" "ScenarioEditor\n" "Title\n";
}


std::shared_ptr<Scene>
SceneBuilder::build(std::string_view name) const
{
	if (name == "Battle")
		return battle();
	if (name == "Campaign")
		return campaign();
	if (name == "ScenarioEditor")
		return scenario_editor();
	return title();
}


std::shared_ptr<Scene>
SceneBuilder::battle() const
{
	return std::make_shared<Battle>(session);
}


std::shared_ptr<Scene>
SceneBuilder::campaign() const
{
	return std::make_shared<Campaign>(session);
}


std::shared_ptr<Scene>
SceneBuilder::scenario_editor() const
{
	return std::make_shared<ScenarioEditor>(session);
}


std::shared_ptr<Scene>
SceneBuilder::title() const
{
	return std::make_shared<Title>(session);
}


}  // namespace kurator