The Battle for Wesnoth  1.17.0-dev
ptr.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2021
3  by Chris Beck <render787@gmail.com>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
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,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 #pragma once
17 
19 
20 #include <memory>
21 
22 class unit;
23 
26 typedef std::shared_ptr<unit> unit_ptr;
27 typedef std::shared_ptr<const unit> unit_const_ptr;
28 
29 // And attacks too!
30 
31 class attack_type;
32 
33 using attack_ptr = std::shared_ptr<attack_type>;
34 using const_attack_ptr = std::shared_ptr<const attack_type>;
This class represents a single unit of a specific type.
Definition: unit.hpp:121
utils::shared_reference< unit > nonempty_unit_ptr
Definition: ptr.hpp:22
std::shared_ptr< unit > unit_ptr
Definition: ptr.hpp:26
std::shared_ptr< const unit > unit_const_ptr
Definition: ptr.hpp:27
utils::shared_reference< const unit > nonempty_unit_const_ptr
Definition: ptr.hpp:25
std::shared_ptr< attack_type > attack_ptr
Definition: ptr.hpp:33
std::shared_ptr< const attack_type > const_attack_ptr
Definition: ptr.hpp:34