diff --git a/agb/src/display/tiled/map.rs b/agb/src/display/tiled/map.rs index c094e966..bfe3399e 100644 --- a/agb/src/display/tiled/map.rs +++ b/agb/src/display/tiled/map.rs @@ -15,7 +15,7 @@ use super::{ use crate::syscall::BgAffineSetData; use alloc::{vec, vec::Vec}; -pub trait TiledMapTypes { +pub trait TiledMapTypes: private::Sealed { type Size: BackgroundSize + Copy; } @@ -44,6 +44,8 @@ trait TiledMapPrivate: TiledMapTypes { } } +/// Trait which describes methods available on both tiled maps and affine maps. Note that +/// it is 'sealed' so you cannot implement this yourself. pub trait TiledMap: TiledMapTypes { fn clear(&mut self, vram: &mut VRamManager); fn show(&mut self); @@ -429,3 +431,10 @@ impl<'a, T> Drop for MapLoan<'a, T> { } } } + +mod private { + pub trait Sealed {} + + impl Sealed for super::RegularMap {} + impl Sealed for super::AffineMap {} +}