resource: add BlockType::is() method to check for flags

This commit is contained in:
Matthias Schiffer 2023-02-15 00:20:15 +01:00
parent 2a941e5283
commit 339e0b6a05
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C

View file

@ -28,6 +28,12 @@ pub struct BlockType {
pub color: BlockColor,
}
impl BlockType {
pub fn is(&self, flag: BlockFlag) -> bool {
self.flags.contains(flag)
}
}
pub type BlockTypeMap = HashMap<String, BlockType>;
pub fn block_types() -> BlockTypeMap {