mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-05 17:44:52 +01:00
resource: add BlockType::is() method to check for flags
This commit is contained in:
parent
2a941e5283
commit
339e0b6a05
1 changed files with 6 additions and 0 deletions
|
@ -28,6 +28,12 @@ pub struct BlockType {
|
||||||
pub color: BlockColor,
|
pub color: BlockColor,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl BlockType {
|
||||||
|
pub fn is(&self, flag: BlockFlag) -> bool {
|
||||||
|
self.flags.contains(flag)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub type BlockTypeMap = HashMap<String, BlockType>;
|
pub type BlockTypeMap = HashMap<String, BlockType>;
|
||||||
|
|
||||||
pub fn block_types() -> BlockTypeMap {
|
pub fn block_types() -> BlockTypeMap {
|
||||||
|
|
Loading…
Add table
Reference in a new issue