The Battle for Wesnoth  1.15.0+dev
overlay.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2018 by Fabian Mueller <fabianmueller5@gmx.de>
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #pragma once
16 
17 #include "halo.hpp"
18 
19 struct overlay
20 {
21 
22  overlay(const std::string& img,
23  const std::string& halo_img,
25  const std::string& overlay_team_name,
26  const std::string& item_id,
27  const bool fogged,
28  float item_z_order = 0)
29  : image(img)
30  , halo(halo_img)
31  , team_name(overlay_team_name)
32  , id(item_id)
33  , halo_handle(handle)
34  , visible_in_fog(fogged)
35  , z_order(item_z_order)
36  {}
37 
38 
39  overlay(const config& cfg)
40  : image(cfg["image"])
41  , halo(cfg["halo"])
42  , team_name(cfg["team_name"])
43  , name(cfg["name"].t_str())
44  , id(cfg["id"])
45  , halo_handle()
46  , visible_in_fog(cfg["visible_in_fog"].to_bool())
47  , z_order(cfg["z_order"].to_double(0))
48  {
49  }
50 
51  std::string image;
52  std::string halo;
53  std::string team_name;
55  std::string id;
56 
59  float z_order;
60 
61 };
float z_order
Definition: overlay.hpp:59
halo::handle halo_handle
Definition: overlay.hpp:57
bool visible_in_fog
Definition: overlay.hpp:58
overlay(const std::string &img, const std::string &halo_img, halo::handle handle, const std::string &overlay_team_name, const std::string &item_id, const bool fogged, float item_z_order=0)
Definition: overlay.hpp:22
std::string id
Definition: overlay.hpp:55
t_string name
Definition: overlay.hpp:54
std::string halo
Definition: overlay.hpp:52
Definition: display.hpp:44
this module manages the cache of images.
std::string team_name
Definition: overlay.hpp:53
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:92
std::shared_ptr< halo_record > handle
Definition: halo.hpp:31
overlay(const config &cfg)
Definition: overlay.hpp:39
std::string image
Definition: overlay.hpp:51