yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
pit_damage_table.h
Go to the documentation of this file.
1#ifndef YAZE_ZELDA3_DUNGEON_PIT_DAMAGE_TABLE_H_
2#define YAZE_ZELDA3_DUNGEON_PIT_DAMAGE_TABLE_H_
3
4#include <cstdint>
5#include <vector>
6
7#include "absl/status/status.h"
8#include "rom/rom.h"
9
10namespace yaze {
11namespace zelda3 {
12
13// ROM-backed membership table for RoomsWithPitDamage (bank $07).
14// Falling in a listed room deals damage; unlisted rooms use per-room pit
15// destination metadata from the room header instead.
17 public:
18 static absl::Status LoadFromRom(Rom* rom, PitDamageTable* out);
19 absl::Status SaveToRom(Rom* rom) const;
20
21 const std::vector<uint16_t>& room_ids() const { return room_ids_; }
22 bool Contains(uint16_t room_id) const;
23 void SetRoomIds(std::vector<uint16_t> room_ids);
24 absl::Status ReplaceRoomId(uint16_t old_room_id, uint16_t new_room_id);
25 void MarkDirty() { dirty_ = true; }
26 void ClearDirty() { dirty_ = false; }
27 bool dirty() const { return dirty_; }
28
29 private:
30 std::vector<uint16_t> room_ids_;
31 bool dirty_ = false;
32};
33
34} // namespace zelda3
35} // namespace yaze
36
37#endif // YAZE_ZELDA3_DUNGEON_PIT_DAMAGE_TABLE_H_
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:28
void SetRoomIds(std::vector< uint16_t > room_ids)
static absl::Status LoadFromRom(Rom *rom, PitDamageTable *out)
const std::vector< uint16_t > & room_ids() const
absl::Status ReplaceRoomId(uint16_t old_room_id, uint16_t new_room_id)
bool Contains(uint16_t room_id) const
std::vector< uint16_t > room_ids_
absl::Status SaveToRom(Rom *rom) const