The Battle for Wesnoth  1.15.1+dev
make.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2018 by Chris Beck <render787@gmail.com>
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 #include "units/make.hpp"
16 #include "units/unit.hpp"
17 
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:99
unit_ptr clone() const
Definition: unit.hpp:173
static unit_ptr create(const config &cfg, bool use_traits=false, const vconfig *vcfg=nullptr)
Initializes a unit from a config.
Definition: unit.hpp:154
A single unit type that the player may recruit.
Definition: types.hpp:42
unit_ptr make_unit_ptr(const config &cfg, bool use_traits, const vconfig *vcfg)
Definition: make.cpp:18
boost::intrusive_ptr< unit > unit_ptr
Definition: ptr.hpp:29
double t
Definition: astarsearch.cpp:64
A variable-expanding proxy for the config class.
Definition: variable.hpp:42
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:92