load CON files
This commit is contained in:
47
src/arena.rs
Normal file
47
src/arena.rs
Normal file
@@ -0,0 +1,47 @@
|
||||
use world;
|
||||
use tile::Tile;
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
// offset len notes
|
||||
// 0x0 16 start_x for monsters 0-15
|
||||
// 0x10 16 start_y for monsters 0-15
|
||||
// 0x20 8 start_x for party members 0-7
|
||||
// 0x28 8 start_y for party members 0-7
|
||||
// 0x30 16 ???
|
||||
// 0x40 121 11x11 map matrix
|
||||
// 0xB9 7 ???
|
||||
pub struct Arena {
|
||||
monster_x: [u8; 16],
|
||||
monster_y: [u8; 16],
|
||||
party_x: [u8; 8],
|
||||
party_y: [u8; 8],
|
||||
_unknown1: [u8; 16],
|
||||
map: Field,
|
||||
_unknown2: [u8; 7],
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct Shrine {
|
||||
map: Field,
|
||||
_unknown1: [[u8; 8]; 8], // Arbitrary grouping for Clone impl
|
||||
_unknown2: [u8; 7],
|
||||
}
|
||||
|
||||
type Field = [[Tile; 11]; 11];
|
||||
impl world::Map for Field {
|
||||
fn rows<'a>(&'a self) -> world::BoxedMapIterator {
|
||||
Box::new(self.iter().map(|row| Box::new(row.into_iter()) as world::RowIterator<'a>))
|
||||
}
|
||||
}
|
||||
|
||||
impl world::HasMap for Arena {
|
||||
fn map(&self) -> &world::Map {
|
||||
&self.map
|
||||
}
|
||||
}
|
||||
|
||||
impl world::HasMap for Shrine {
|
||||
fn map(&self) -> &world::Map {
|
||||
&self.map
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user