The Battle for Wesnoth  1.19.0-dev
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2024
3  by Chris Beck <>
4  Part of the Battle for Wesnoth Project
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
13  See the COPYING file for more details.
14 */
16 #include "units/make.hpp"
17 #include "units/unit.hpp"
19 unit_ptr make_unit_ptr(const config& cfg, bool use_traits, const vconfig* vcfg)
20 {
21  return unit::create(cfg, use_traits, vcfg);
22 }
23 unit_ptr make_unit_ptr(const unit_type& t, int side, bool real_unit, unit_race::GENDER gender)
24 {
25  return unit::create(t, side, real_unit, gender);
26 }
28 {
29  return u.clone();
30 }
double t
Definition: astarsearch.cpp:63
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:159
A single unit type that the player may recruit.
Definition: types.hpp:43
This class represents a single unit of a specific type.
Definition: unit.hpp:133
unit_ptr clone() const
Definition: unit.hpp:221
static unit_ptr create(const config &cfg, bool use_traits=false, const vconfig *vcfg=nullptr)
Initializes a unit from a config.
Definition: unit.hpp:201
A variable-expanding proxy for the config class.
Definition: variable.hpp:45
unit_ptr make_unit_ptr(const config &cfg, bool use_traits, const vconfig *vcfg)
Definition: make.cpp:19
std::shared_ptr< unit > unit_ptr
Definition: ptr.hpp:26