The Battle for Wesnoth 1.21.0-dev
 
Loading...
Searching...
No Matches
ptr.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2014 - 2025
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
22class unit;
23
26typedef std::shared_ptr<unit> unit_ptr;
27typedef std::shared_ptr<const unit> unit_const_ptr;
28
29// And attacks too!
30
31class attack_type;
32
33using attack_ptr = std::shared_ptr<attack_type>;
34using const_attack_ptr = std::shared_ptr<const attack_type>;
35
36class unit_ability_t;
37
38using ability_ptr = std::shared_ptr<unit_ability_t>;
39using const_ability_ptr = std::shared_ptr<const unit_ability_t>;
40
This class represents a single unit of a specific type.
Definition unit.hpp:39
utils::shared_reference< const unit > nonempty_unit_const_ptr
Definition ptr.hpp:25
std::shared_ptr< const unit_ability_t > const_ability_ptr
Definition ptr.hpp:39
utils::shared_reference< unit > nonempty_unit_ptr
Definition ptr.hpp:24
std::shared_ptr< const unit > unit_const_ptr
Definition ptr.hpp:27
std::shared_ptr< const attack_type > const_attack_ptr
Definition ptr.hpp:34
std::shared_ptr< unit_ability_t > ability_ptr
Definition ptr.hpp:38
std::shared_ptr< attack_type > attack_ptr
Definition ptr.hpp:33
std::shared_ptr< unit > unit_ptr
Definition ptr.hpp:26