FastEngine 0.9.4
A multiplayer oriented 2D engine made with Vulkan.
Loading...
Searching...
No Matches
C_objTilelayer.hpp
1/*
2 * Copyright 2025 Guillaume Guillet
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef _FGE_C_OBJTILELAYER_HPP_INCLUDED
18#define _FGE_C_OBJTILELAYER_HPP_INCLUDED
19
20#include "FastEngine/fge_extern.hpp"
21#include "C_object.hpp"
22#include "FastEngine/C_tilelayer.hpp"
23#include "FastEngine/C_tilemap.hpp"
24
25#define FGE_OBJTILELAYER_CLASSNAME "FGE:OBJ:TILELAYER"
26
27namespace fge
28{
29
30class FGE_API ObjTileLayer : public fge::Object
31{
32public:
33 ObjTileLayer() = default;
34 ObjTileLayer(std::shared_ptr<TileMap> tilemap, std::shared_ptr<TileLayer> tilelayer);
35 ~ObjTileLayer() override = default;
36
37 FGE_OBJ_DEFAULT_COPYMETHOD(fge::ObjTileLayer)
38
39 FGE_OBJ_DRAW_DECLARE
40
41 void clear();
42
43 void setLayerName(std::string_view name);
44 [[nodiscard]] std::string const& getLayerName() const;
45 void setData(std::shared_ptr<TileMap> tilemap, std::shared_ptr<TileLayer> tilelayer);
46
47 [[nodiscard]] std::shared_ptr<TileMap> getTileMap() const;
48
49 char const* getClassName() const override;
50 char const* getReadableClassName() const override;
51
52 fge::RectFloat getGlobalBounds() const override;
53 fge::RectFloat getLocalBounds() const override;
54
55private:
56 std::weak_ptr<TileMap> g_tileMap;
57 std::shared_ptr<TileLayer> g_tileLayer;
58 std::string g_layerName;
59};
60
61} // namespace fge
62
63#endif // _FGE_C_OBJTILELAYER_HPP_INCLUDED
Definition C_objTilelayer.hpp:31
fge::RectFloat getLocalBounds() const override
Get the local bounds of the object (without any transformations)
char const * getReadableClassName() const override
Get a readable version of the class name.
fge::RectFloat getGlobalBounds() const override
Get the global bounds of the object.
char const * getClassName() const override
Get the unique class name of the object.
The Object class is the base class for all objects in the engine.
Definition C_object.hpp:102
A tile layer contain a matrix of global tile id and a list of TileSet.
Definition C_tilelayer.hpp:116
Definition C_tilemap.hpp:31