mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 16:21:33 +11:00
Seal the TiledMap trait
This commit is contained in:
parent
5c578df227
commit
9bddbdba1c
|
@ -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 {}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue