Horizon Official Technical Documentation
GridObject.hpp
Go to the documentation of this file.
1/***************************************************
2 * _ _ _ *
3 * | | | | (_) *
4 * | |_| | ___ _ __ _ _______ _ __ *
5 * | _ |/ _ \| '__| |_ / _ \| '_ \ *
6 * | | | | (_) | | | |/ / (_) | | | | *
7 * \_| |_/\___/|_| |_/___\___/|_| |_| *
8 ***************************************************
9 * This file is part of Horizon (c).
10 *
11 * Copyright (c) 2019 Sagun K. (sagunxp@gmail.com).
12 * Copyright (c) 2019 Horizon Dev Team.
13 *
14 * Base Author - Sagun K. (sagunxp@gmail.com)
15 *
16 * This library is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation, either version 3 of the License, or
19 * (at your option) any later version.
20 *
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this library. If not, see <http://www.gnu.org/licenses/>.
28 **************************************************/
29
30#ifndef HORIZON_ZONE_GAME_GRIDOBJECT_HPP
31#define HORIZON_ZONE_GAME_GRIDOBJECT_HPP
32
35
36namespace Horizon
37{
38namespace Zone
39{
40template<class T>
42{
43public:
44 virtual ~GridObject() { }
45
46 bool has_valid_grid_reference() const { return _ref.is_valid(); }
49
51
52private:
54};
55}
56}
57
58#endif /* HORIZON_ZONE_GAME_GRIDOBJECT_HPP */
void link(TO *toObj, FROM *fromObj)
Links the Reference to the specified object by adding it to the front of the list.
Definition: Reference.hpp:49
bool is_valid() const
Definition: Reference.hpp:84
void remove()
Definition: Reference.hpp:67
Definition: GridObject.hpp:42
void add_grid_reference(GridRefManager< T > &m)
Definition: GridObject.hpp:47
GridReference< T > _ref
Definition: GridObject.hpp:53
virtual ~GridObject()
Definition: GridObject.hpp:44
GridReference< T > & get_reference()
Definition: GridObject.hpp:50
bool has_valid_grid_reference() const
Definition: GridObject.hpp:46
void remove_grid_reference()
Definition: GridObject.hpp:48
Definition: Element.hpp:7