This repository has been archived by the owner on Sep 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
time_of_day.hpp
84 lines (66 loc) · 2.21 KB
/
time_of_day.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
74
75
76
77
78
79
80
81
82
83
84
/* $Id: time_of_day.hpp 48153 2011-01-01 15:57:50Z mordante $ */
/*
Copyright (C) 2003 - 2011 by David White <dave@whitevine.net>
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 */
#ifndef TIME_OF_DAY_HPP_INCLUDED
#define TIME_OF_DAY_HPP_INCLUDED
#include "tstring.hpp"
#include <vector>
class config;
/**
* Object which defines a time of day
* with associated bonuses, image, sounds etc.
*/
struct time_of_day
{
/**
* A default-constructed time of day object shouldn't really be used
* so this only loads some null values. Ideally, there should be
* getters for properties that would emit a warning when such an object
* is actually used, but it does not seem necessary at the moment.
*/
explicit time_of_day();
/** Construct a time of day from config */
explicit time_of_day(const config& cfg);
void write(config& cfg) const;
/** The % bonus lawful units receive. Chaotics receive -lawful_bonus. */
int lawful_bonus;
int lawful_bonus_modified;
/** The % bonus liminal units receive. */
int liminal_bonus;
int liminal_bonus_modified;
bool liminal_present;
/** The image to be displayed in the game status. */
std::string image;
t_string name;
std::string id;
/**
* The image that is to be laid over all images
* while this time of day lasts.
*/
std::string image_mask;
/**
* The color modifications that should be made
* to the game board to reflect the time of day.
*/
int red, green, blue;
/**
* List of "ambient" sounds associated with this time_of_day,
* Played at the beginning of turn.
*/
std::string sounds;
/**
* Parse config and add time of day entries into passed vector
*/
static void parse_times(const config& cfg, std::vector<time_of_day>& normal_times);
};
#endif