-
-
Notifications
You must be signed in to change notification settings - Fork 990
/
controller.hpp
73 lines (54 loc) · 1.63 KB
/
controller.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
68
69
70
71
72
73
/*
Copyright (C) 2009 - 2016 by Ignacio R. Morelle <shadowm2006@gmail.com>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/
/**
* @file
* Storyscreen controller (interface).
*/
#ifndef STORYSCREEN_CONTROLLER_HPP_INCLUDED
#define STORYSCREEN_CONTROLLER_HPP_INCLUDED
#include "events.hpp"
#include "interface.hpp"
#include <boost/shared_ptr.hpp>
class CVideo;
class vconfig;
namespace storyscreen {
enum STORY_RESULT {
NEXT,
BACK,
QUIT
};
class part;
class part_ui;
class floating_image;
class controller
{
public:
controller(CVideo& video, const vconfig& data, const std::string& scenario_name,
int segment_index);
/**
* Display all story screen parts in a first..last sequence.
*/
STORY_RESULT show(START_POSITION startpos=START_BEGINNING);
private:
typedef boost::shared_ptr< part > part_pointer_type;
typedef boost::shared_ptr< part_ui > render_pointer_type;
// Executes WML flow instructions and inserts parts.
void resolve_wml(const vconfig& cfg);
CVideo& video_;
const events::event_context evt_context_;
std::string scenario_name_;
int segment_index_;
// The part cache.
std::vector< part_pointer_type > parts_;
};
} // end namespace storyscreen
#endif /* ! STORYSCREEN_CONTROLLER_HPP_INCLUDED */