ScummVM API documentation
map.h
1
/* ScummVM - Graphic Adventure Engine
2
*
3
* ScummVM is the legal property of its developers, whose names
4
* are too numerous to list here. Please refer to the COPYRIGHT
5
* file distributed with this source distribution.
6
*
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
*
12
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
19
*
20
*/
21
22
#ifndef ULTIMA8_WORLD_MAP_H
23
#define ULTIMA8_WORLD_MAP_H
24
25
#include "ultima/shared/std/containers.h"
26
27
namespace
Ultima
{
28
namespace
Ultima8 {
29
30
class
Item;
31
32
class
Map
{
33
friend
class
CurrentMap
;
34
public
:
35
explicit
Map
(uint32 mapnum);
36
~
Map
();
37
38
void
clear();
39
40
void
loadNonFixed(
Common::SeekableReadStream
*rs);
41
void
loadFixed(
Common::SeekableReadStream
*rs);
42
void
unloadFixed();
43
44
bool
isEmpty()
const
{
45
return
_fixedItems.size() == 0 && _dynamicItems.size() == 0;
46
}
47
48
void
save(
Common::WriteStream
*ods);
49
bool
load(
Common::ReadStream
*rs, uint32 version);
50
51
private
:
52
53
// load items from something formatted like 'fixed.dat'
54
void
loadFixedFormatObjects(
Std::list<Item *>
&itemlist,
55
Common::SeekableReadStream
*rs,
56
uint32 extendedflags);
57
58
// Add a fixed item to patch game data errors
59
void
addMapFix(uint32 shape, uint32 frame, int32 x, int32 y, int32 z);
60
61
// Q: How should we store the items in a map.
62
// It might make things more efficient if we order them by 'chunk'
63
// (512x512). This would mean we need about 128x128 item lists.
64
65
// It would probably be overkill to permanently maintain all these lists
66
// for all maps, so we could only set them up for the current map.
67
// (which makes me wonder if there should be a separate class for the
68
// active map?)
69
70
// (Note that we probably won't even have all items permanently stored,
71
// since fixed items will be cached out most of the time)
72
73
74
Std::list<Item *>
_fixedItems;
75
Std::list<Item *>
_dynamicItems;
76
77
uint32 _mapNum;
78
};
79
80
}
// End of namespace Ultima8
81
}
// End of namespace Ultima
82
83
#endif
Common::WriteStream
Definition:
stream.h:77
Ultima::Ultima8::Map
Definition:
map.h:32
Common::SeekableReadStream
Definition:
stream.h:745
Ultima
Definition:
detection.h:27
Ultima::Std::list
Definition:
containers.h:200
Common::ReadStream
Definition:
stream.h:385
Ultima::Ultima8::CurrentMap
Definition:
current_map.h:44
engines
ultima
ultima8
world
map.h
Generated on Fri Nov 22 2024 09:10:19 for ScummVM API documentation by
1.8.13