V-Gears 0
Free Final Fantasy VII engine.
VGearsMapFile.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 The V-Gears Team
3 *
4 * This file is part of V-Gears
5 *
6 * V-Gears is free software: you can redistribute it and/or modify it under
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, version 3.0 (GPLv3) of the License.
9 *
10 * V-Gears is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#pragma once
17
19#include "core/EntityPoint.h"
20#include "core/EntityTrigger.h"
21
22namespace VGears{
23
27 class MapFile : public Resource{
28
29 public:
30
34 static const String RESOURCE_TYPE;
35
50 MapFile(
51 Ogre::ResourceManager* creator, const String &name, Ogre::ResourceHandle handle,
52 const String& group, bool is_manual = false, Ogre::ManualResourceLoader* loader = NULL
53 );
54
58 virtual ~MapFile();
59
61
62 typedef std::vector<Point> PointList;
63
65
66 typedef std::vector<Trigger> TriggerList;
67
73 virtual const String& GetScriptName() const;
74
80 virtual const String& GetBackground2dName() const;
81
87 virtual const String& GetTextsName() const;
88
94 virtual const String& GetWalkmeshName() const;
95
104 virtual const Ogre::Real& GetForwardDirection() const;
105
111 virtual PointList& GetPoints();
112
118 virtual TriggerList& GetTriggers();
119
125 virtual void SetScriptName(const String& script_name);
126
132 virtual void SetBackground2dName(const String& background2d_name);
133
139 virtual void SetTextsName(const String& texts_name);
140
146 virtual void SetWalkmeshName(const String& walkmesh_name);
147
156 virtual void SetForwardDirection(const Ogre::Real& forward_direction);
157
158 protected:
159
163 virtual void loadImpl() override;
164
168 virtual void unloadImpl() override;
169
177 virtual size_t calculateSize() const;
178
179 private:
180
185
190
195
200
205
210
215 };
216
217 typedef Ogre::SharedPtr<MapFile> MapFilePtr;
218}
219
An entity point.
Definition: EntityPoint.h:22
An entity trigger.
Definition: EntityTrigger.h:25
Handles map files.
Definition: VGearsMapFile.h:27
String background_2d_name_
The background file name.
Definition: VGearsMapFile.h:189
String script_name_
The script file name.
Definition: VGearsMapFile.h:184
TriggerList triggers_
The list of triggers.
Definition: VGearsMapFile.h:214
virtual void SetBackground2dName(const String &background2d_name)
Sets the map background file name.
Definition: VGearsMapFile.cpp:66
virtual size_t calculateSize() const
Calculates the size of the map.
Definition: VGearsMapFile.cpp:43
std::vector< Trigger > TriggerList
Definition: VGearsMapFile.h:66
virtual void SetWalkmeshName(const String &walkmesh_name)
Sets the map walkmesh file name.
Definition: VGearsMapFile.cpp:72
virtual void SetForwardDirection(const Ogre::Real &forward_direction)
Sets the map forward direction.
Definition: VGearsMapFile.cpp:74
MapFile(Ogre::ResourceManager *creator, const String &name, Ogre::ResourceHandle handle, const String &group, bool is_manual=false, Ogre::ManualResourceLoader *loader=NULL)
Constructor.
Definition: VGearsMapFile.cpp:23
virtual PointList & GetPoints()
Retrieves the list of entity points in the map.
Definition: VGearsMapFile.cpp:60
virtual void SetScriptName(const String &script_name)
Sets the map script name.
Definition: VGearsMapFile.cpp:64
String texts_name_
The background file name.
Definition: VGearsMapFile.h:194
virtual ~MapFile()
Destructor.
Definition: VGearsMapFile.cpp:28
virtual void unloadImpl() override
Unloads the file.
Definition: VGearsMapFile.cpp:36
String walkmesh_name_
The walkmesh file name.
Definition: VGearsMapFile.h:199
EntityPoint Point
Definition: VGearsMapFile.h:60
virtual void loadImpl() override
Loads the file.
Definition: VGearsMapFile.cpp:30
virtual const String & GetWalkmeshName() const
Retrieves the map walkmesh file name.
Definition: VGearsMapFile.cpp:56
EntityTrigger Trigger
Definition: VGearsMapFile.h:64
virtual TriggerList & GetTriggers()
Retrieves the map triggers.
Definition: VGearsMapFile.cpp:62
virtual const String & GetBackground2dName() const
Retrieves the map background file name.
Definition: VGearsMapFile.cpp:52
Ogre::Real forward_direction_
The forward direction.
Definition: VGearsMapFile.h:204
std::vector< Point > PointList
Definition: VGearsMapFile.h:62
virtual void SetTextsName(const String &texts_name)
Sets the map field texts file name.
Definition: VGearsMapFile.cpp:70
virtual const String & GetScriptName() const
Retrieves the map script name.
Definition: VGearsMapFile.cpp:50
PointList points_
The list of entity points.
Definition: VGearsMapFile.h:209
static const String RESOURCE_TYPE
The type of resource.
Definition: VGearsMapFile.h:34
virtual const String & GetTextsName() const
Retrieves the map texts file name.
Definition: VGearsMapFile.cpp:54
virtual const Ogre::Real & GetForwardDirection() const
Retrieves the map forward direction.
Definition: VGearsMapFile.cpp:58
A resource.
Definition: VGearsResource.h:29
Definition: FF7NameLookup.h:24
Ogre::SharedPtr< WorldmapFile > MapFilePtr
Definition: WorldmapFile.h:76
Ogre::String String
Definition: TypeDefine.h:37