The Battle for Wesnoth  1.15.12+dev
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2018 by Chris Beck <>
3  Part of the Battle for Wesnoth Project
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,
12  See the COPYING file for more details.
13 */
15 #include "units/make.hpp"
16 #include "units/unit.hpp"
18 unit_ptr make_unit_ptr(const config& cfg, bool use_traits, const vconfig* vcfg)
19 {
20  return unit::create(cfg, use_traits, vcfg);
21 }
22 unit_ptr make_unit_ptr(const unit_type& t, int side, bool real_unit, unit_race::GENDER gender)
23 {
24  return unit::create(t, side, real_unit, gender);
25 }
27 {
28  return u.clone();
29 }
This class represents a single unit of a specific type.
Definition: unit.hpp:120
unit_ptr clone() const
Definition: unit.hpp:209
std::shared_ptr< unit > unit_ptr
Definition: ptr.hpp:25
static unit_ptr create(const config &cfg, bool use_traits=false, const vconfig *vcfg=nullptr)
Initializes a unit from a config.
Definition: unit.hpp:189
A single unit type that the player may recruit.
Definition: types.hpp:44
unit_ptr make_unit_ptr(const config &cfg, bool use_traits, const vconfig *vcfg)
Definition: make.cpp:18
double t
Definition: astarsearch.cpp:64
A variable-expanding proxy for the config class.
Definition: variable.hpp:44
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:59