Horizon Official Technical Documentation
SharedResourceTransformer.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_SHARED_RESOURCE_TRANSFORMER_HPP
31#define HORIZON_ZONE_GAME_SHARED_RESOURCE_TRANSFORMER_HPP
32
33namespace Horizon
34{
35namespace Zone
36{
37namespace Game
38{
39template <typename T>
41{
42public:
43 SharedResourceTransformer(std::shared_ptr<T> transformation) : _transformation(transformation) { }
45
46private:
47 std::shared_ptr<T> _transformation;
48};
49
50template <typename T>
51class SharedResourceTransformationSaver : public SharedResourceTransformer
52{
53public:
54 SharedResourceTransformationSaver() : SharedResourceTransformer()
55 {
56
57 }
58
60
61 void prepare();
62 void verify();
63 void save();
64};
65
66template <typename T>
67class SharedResourceTransformationLoader : public SharedResourceTransformer
68{
69public:
70 SharedResourceTransformationLoader() : SharedResourceTransformer()
71 {
72
73 }
74
76
77 void prepare();
78 void verify();
79 void load();
80};
81}
82}
83}
84
85#endif /* HORIZON_ZONE_GAME_SHARED_RESOURCE_TRANSFORMER_HPP */
Definition: SharedResourceTransformer.hpp:41
~SharedResourceTransformer()
Definition: SharedResourceTransformer.hpp:44
std::shared_ptr< T > _transformation
Definition: SharedResourceTransformer.hpp:47
SharedResourceTransformer(std::shared_ptr< T > transformation)
Definition: SharedResourceTransformer.hpp:43
Definition: SharedResourceTransformer.hpp:68
~SharedResourceTransformationLoader()
Definition: SharedResourceTransformer.hpp:75
SharedResourceTransformationLoader()
Definition: SharedResourceTransformer.hpp:70
Definition: SharedResourceTransformer.hpp:52
~SharedResourceTransformationSaver()
Definition: SharedResourceTransformer.hpp:59
SharedResourceTransformationSaver()
Definition: SharedResourceTransformer.hpp:54
Definition: Element.hpp:7