ScummVM API documentation
arena.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 ULTIMA3_DATA_ARENA_H
23#define ULTIMA3_DATA_ARENA_H
24
25#include "common/scummsys.h"
26
27namespace Ultima {
28namespace Ultima3 {
29namespace Data {
30
31constexpr int ARENA_SIZE = 11;
32constexpr int ARENA_MONSTERS = 8;
33constexpr int ARENA_PLAYERS = 4;
34
35// Marks a party member who isn't in the fight
36constexpr byte ARENA_ABSENT = 0xFF;
37
43struct Arena {
44 byte _tiles[ARENA_SIZE * ARENA_SIZE] = {};
45 byte _monsterX[ARENA_MONSTERS] = {};
46 byte _monsterY[ARENA_MONSTERS] = {};
47 byte _monsterUnder[ARENA_MONSTERS] = {};
48
49 // Hit points, with none meaning there's no monster
50 byte _monsterHp[ARENA_MONSTERS] = {};
51
52 byte _playerX[ARENA_PLAYERS] = {};
53 byte _playerY[ARENA_PLAYERS] = {};
54 byte _playerUnder[ARENA_PLAYERS] = {};
55 byte _playerTile[ARENA_PLAYERS] = {};
56
60 void load(const char *filename);
61
62 byte tile(int x, int y) const {
63 return _tiles[y * ARENA_SIZE + x];
64 }
65
66 void setTile(int x, int y, byte value) {
67 _tiles[y * ARENA_SIZE + x] = value;
68 }
69};
70
71} // namespace Data
72} // namespace Ultima3
73} // namespace Ultima
74
75#endif
Definition: arena.h:43
void load(const char *filename)