pub struct Memory {
pub logger: Box<dyn Fn(&str)>,
pub graphics: Vec<u8>,
pub fontatlas: Vec<bool>,
pub map: Vec<u8>,
pub sprites: Vec<u8>,
pub flags: Vec<u8>,
pub buttons: Vec<bool>,
pub pallete: Vec<ColorState>,
pub camera: Vector,
pub rng: ThreadRng,
}Fields§
§logger: Box<dyn Fn(&str)>§graphics: Vec<u8>§fontatlas: Vec<bool>§map: Vec<u8>§sprites: Vec<u8>§flags: Vec<u8>§pallete: Vec<ColorState>§camera: Vector§rng: ThreadRngImplementations§
Source§impl Memory
impl Memory
pub fn new( map: String, sprites: String, flags: String, fontatlas: String, ) -> Memory
pub fn spr(&mut self, sprite: u8, x: i32, y: i32, flip: Option<FlipState>)
pub fn map( &mut self, celx: u8, cely: u8, sx: i32, sy: i32, celw: u8, celh: u8, mask: u8, )
pub fn circfill(&mut self, xc: u8, yc: u8, r: i8, c: u8)
pub fn draw_circ(&mut self, xc: i32, yc: i32, x: i32, y: i32, c: u8)
pub fn rrectfill(&mut self, x: i32, y: i32, x1: i32, y1: i32, col: u8)
pub fn camera(&mut self, x: f32, y: f32)
pub fn rectfill(&mut self, x: i32, y: i32, x2: i32, y2: i32, c: u8)
pub fn pal(&mut self, index: usize, color: u8)
pub fn palt(&mut self, index: usize, transparent: bool)
pub fn pal_reset(&mut self)
pub fn print(&mut self, text: &str, x: i32, y: i32, col: u8)
pub fn pset(&mut self, col: u8, x: i32, y: i32)
pub fn mget(&self, x: u8, y: u8) -> u8
pub fn mset(&mut self, x: u8, y: u8, tile: u8)
pub fn fget(&self, sprnum: u8, idx: u8) -> bool
pub fn fget_all(&self, sprnum: u8) -> u8
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Memory
impl<'de> Deserialize<'de> for Memory
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Memory
impl !RefUnwindSafe for Memory
impl !Send for Memory
impl !Sync for Memory
impl Unpin for Memory
impl !UnwindSafe for Memory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more