51 if (tokens.size() != n)
65 std::vector<Common::UString> strings;
68 if (strings.empty()) {
70 }
else if (*strings[0].begin() ==
'#') {
72 }
else if (strings[0] ==
"filedependancy") {
76 }
else if (strings[0] ==
"roomcount") {
85 for (
int i = 0; i < roomCount; i++) {
91 _rooms[i].model = strings[0];
98 }
else if (strings[0] ==
"trackcount") {
106 for (
int i = 0; i < trackCount; i++)
109 }
else if (strings[0] ==
"obstaclecount") {
117 for (
int i = 0; i < obstacleCount; i++)
120 }
else if (strings[0] ==
"artplaceablecount") {
125 int artPlaceablesCount;
129 for (
int i = 0; i < artPlaceablesCount; i++) {
141 }
else if (strings[0] ==
"walkmeshRooms") {
146 int walkmeshRoomCount;
149 for (
int i = 0; i < walkmeshRoomCount; i++) {
155 for (
size_t j = 0; j <
_rooms.size(); j++) {
156 if (
_rooms[j].model.equals(strings[0]))
161 }
else if (strings[0] ==
"doorhookcount") {
170 for (
int i = 0; i < doorHookCount; i++) {
189 }
else if (strings[0] ==
"beginlayout") {
191 }
else if (strings[0] ==
"donelayout") {
195 throw Common::Exception(
"LYTFile::load(): Unknown token %s", strings[0].c_str());
A class holding an UTF-8 string.
void clear()
Clear all information.
virtual bool eos() const =0
Returns true if a read failed because the stream has been reached.
const DoorHookArray & getDoorHooks() const
Get all door hooks in this layout.
void addChunkEnd(uint32 c)
Add a character marking the end of a chunk.
Utility templates and functions for working with strings and streams.
Exception that provides a stack of explanations.
Basic exceptions to throw.
void assertTokenCount(const std::vector< Common::UString > &tokens, size_t n, const Common::UString &name)
const char * c_str() const
Return the (utf8 encoded) string data.
const RoomArray & getRooms() const
Get all rooms in this layout.
Utility templates and functions.
std::vector< Room > RoomArray
ArtPlaceableArray _artPlaceables
std::vector< ArtPlaceable > ArtPlaceableArray
void addIgnore(uint32 c)
Add a character to ignore.
Basic reading stream interfaces.
size_t getTokens(SeekableReadStream &stream, std::vector< UString > &list, size_t min=0, size_t max=SIZE_MAX, const UString &def="")
Parse tokens out of the stream.
Common::UString _fileDependency
Parse tokens out of a stream.
void nextChunk(SeekableReadStream &stream)
Skip past end of chunk characters.
Ignore all repeated separators.
const ArtPlaceableArray & getArtPlaceables() const
Get art placeables in this layout.
void addSeparator(uint32 c)
Add a character on where to split tokens.
void load(Common::SeekableReadStream &lyt)
Load a LYT file.
void clear()
Clear the string's contents.
Common::UString getFileDependency() const
Get the file dependency in this layout.
std::vector< DoorHook > DoorHookArray
Interface for a seekable & readable data stream.
void parseString(const UString &str, T &value, bool allowEmpty)
Parse a string into any POD integer, float/double or bool type.
Handling BioWare's LYTs (Layout files).