xoreos  0.0.5
lytfile.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef AURORA_LYTFILE_H
26 #define AURORA_LYTFILE_H
27 
28 #include <vector>
29 
30 #include "src/common/types.h"
31 #include "src/common/ustring.h"
32 
33 namespace Common {
34  class SeekableReadStream;
35 }
36 
37 namespace Aurora {
38 
55 class LYTFile {
56 public:
58  struct Room {
60  float x, y, z;
61  bool canWalk;
62  };
63 
65  struct ArtPlaceable {
67  float x, y, z;
68  };
69 
71  struct DoorHook {
74  float x, y, z;
75  float unk1, unk2, unk3, unk4, unk5;
76  };
77 
78  typedef std::vector<Room> RoomArray;
79  typedef std::vector<ArtPlaceable> ArtPlaceableArray;
80  typedef std::vector<DoorHook> DoorHookArray;
81 
82  LYTFile();
83  ~LYTFile();
84 
86  void clear();
87 
93 
95  const RoomArray &getRooms() const;
96 
98  const ArtPlaceableArray &getArtPlaceables() const;
99 
101  const DoorHookArray &getDoorHooks() const;
102 
105 
106 private:
111 
112  void assertTokenCount(const std::vector<Common::UString> &tokens, size_t n,
113  const Common::UString &name);
114 };
115 
116 } // End of namespace Aurora
117 
118 #endif // AURORA_LYTFILE_H
Definition: 2dafile.h:39
A class holding an UTF-8 string.
Definition: ustring.h:48
void clear()
Clear all information.
Definition: lytfile.cpp:41
const DoorHookArray & getDoorHooks() const
Get all door hooks in this layout.
Definition: lytfile.cpp:210
An LYT, BioWare&#39;s Layout Format.
Definition: lytfile.h:55
Common::UString model
Definition: lytfile.h:66
A place a door hooks into.
Definition: lytfile.h:71
DoorHookArray _doorHooks
Definition: lytfile.h:109
A simple, non-interactive placeable.
Definition: lytfile.h:65
void assertTokenCount(const std::vector< Common::UString > &tokens, size_t n, const Common::UString &name)
Definition: lytfile.cpp:48
const RoomArray & getRooms() const
Get all rooms in this layout.
Definition: lytfile.cpp:202
Common::UString model
Definition: lytfile.h:59
Common::UString room
Definition: lytfile.h:72
std::vector< Room > RoomArray
Definition: lytfile.h:78
Common::UString name
Definition: lytfile.h:73
ArtPlaceableArray _artPlaceables
Definition: lytfile.h:108
std::vector< ArtPlaceable > ArtPlaceableArray
Definition: lytfile.h:79
Low-level type definitions to handle fixed width types portably.
Unicode string handling.
RoomArray _rooms
Definition: lytfile.h:107
Common::UString _fileDependency
Definition: lytfile.h:110
const ArtPlaceableArray & getArtPlaceables() const
Get art placeables in this layout.
Definition: lytfile.cpp:206
void load(Common::SeekableReadStream &lyt)
Load a LYT file.
Definition: lytfile.cpp:56
Common::UString getFileDependency() const
Get the file dependency in this layout.
Definition: lytfile.cpp:214
std::vector< DoorHook > DoorHookArray
Definition: lytfile.h:80
Interface for a seekable & readable data stream.
Definition: readstream.h:265