~comcloudway/little_town

5be7d20b4611149a5a69596390b6f00fc2c3ef97 — Jakob Meier 1 year, 8 months ago e499ed2
Added Block categories
1 files changed, 134 insertions(+), 14 deletions(-)

M src/game/blocks.rs
M src/game/blocks.rs => src/game/blocks.rs +134 -14
@@ 108,7 108,7 @@ pub enum Block {
    CastleTowerGreen,
    CastleTowerPurple,
    CastleWall,
    CastelWindow,
    CastleWindow,

    DirtCenter,
    DirtLow,


@@ 222,7 222,7 @@ impl Block {
            Block::CastleTowerGreen => include_base_tile!("castle_towerGreen"),
            Block::CastleTowerPurple => include_base_tile!("castle_towerPurple"),
            Block::CastleWall => include_base_tile!("castle_wall"),
            Block::CastelWindow => include_base_tile!("castle_window"),
            Block::CastleWindow => include_base_tile!("castle_window"),

            Block::DirtCenter => include_base_tile!("dirt_center"),
            Block::DirtLow => include_base_tile!("dirt_low"),


@@ 329,7 329,7 @@ impl Block {
            Block::CastleTowerGreen,
            Block::CastleTowerPurple,
            Block::CastleWall,
            Block::CastelWindow,
            Block::CastleWindow,
            Block::DirtCenter,
            Block::DirtLow,
            Block::GrassCenter,


@@ 416,9 416,9 @@ pub enum Category {
    Plants,
    /// River, Lake and water
    Water,
    /// ungrouped blocks
    /// blocks made from wood
    /// i.e bridges
    Other,
    Wood,
    /// all items
    All
}


@@ 432,7 432,7 @@ impl Category {
            Category::Roofs,
            Category::Plants,
            Category::Water,
            Category::Other,
            Category::Wood,
        ]
    }
    /// get name of category


@@ 443,7 443,7 @@ impl Category {
            Category::Roofs => "Roofs",
            Category::Plants => "Plants",
            Category::Water => "Water & River",
            Category::Other => "Other",
            Category::Wood => "Wood",
            Category::All => "All"
        }
    }


@@ 451,22 451,142 @@ impl Category {
    pub fn get_blocks(&self) -> Vec<Block> {
        match self {
            Category::Building => vec![

                Block::BuildingCenter,
                Block::BuildingCenterBeige,
                Block::BuildingCorner,
                Block::BuildingCornerBeige,
                Block::BuildingDoor,
                Block::BuildingDoorBeige,
                Block::BuildingDoorWindows,
                Block::BuildingDoorWindowsBeige,
                Block::BuildingWindow,
                Block::BuildingWindowBeige,
                Block::BuildingWindows,
                Block::BuildingWindowsBeige,
                Block::CastleBend,
                Block::CastleCenter,
                Block::CastleCorner,
                Block::CastleGate,
                Block::CastleGateOpen,
                Block::CastleSlope,
                Block::CastleTower,
                Block::CastleTowerBeige,
                Block::CastleTowerBrown,
                Block::CastleTowerGreen,
                Block::CastleTowerPurple,
                Block::CastleWall,
                Block::CastleWindow,
                Block::RoofChurchBeige,
                Block::RoofChuchBrown,
                Block::RoofChurchGreen,
                Block::RoofChurchPurple,
                Block::RoofGableBeige,
                Block::RoofGableBrown,
                Block::RoofGableGreen,
                Block::RoofGablePurple,
                Block::RoofPointBeige,
                Block::RoofPointBrown,
                Block::RoofPointGreen,
                Block::RoofPointPurple,
                Block::RoofRoundBeige,
                Block::RoofRoundBrown,
                Block::RoofRoundGreen,
                Block::RoofRoundPurple,
                Block::RoofRoundedBeige,
                Block::RoofRoundedBrown,
                Block::RoofRoundedGreen,
                Block::RoofRoundedPurple,
                Block::RoofSlantBeige,
                Block::RoofSlantBrown,
                Block::RoofSlantGreen,
                Block::RoofSlantPurple,
            ],
            Category::Blocks => vec![

                Block::DirtCenter,
                Block::DirtLow,
                Block::GrassCenter,
                Block::GrassCorner,
                Block::GrassPath,
                Block::GrassPathBend,
                Block::GrassPathCorner,
                Block::GrassPathCrossing,
                Block::GrassPathEnd,
                Block::GrassPathEndSquare,
                Block::GrassPathSlope,
                Block::GrassPathSplit,
                Block::GrassRiver,
                Block::GrassRiverBend,
                Block::GrassRiverBridge,
                Block::GrassRiverCorner,
                Block::GrassRiverCrossing,
                Block::GrassRiverEnd,
                Block::GrassRiverEndSquare,
                Block::GrassRiverSlope,
                Block::GrassRiverSplit,
                Block::GrassSlope,
                Block::GrassSlopeConcave,
                Block::GrassSlopeConvex,
                Block::GrassWater,
                Block::GrassWaterConcave,
                Block::GrassWaterConvex,
                Block::GrassWaterRiver,
                Block::WaterCenter,
                Block::WaterFall
            ],
            Category::Roofs => vec![

                Block::RoofChurchBeige,
                Block::RoofChuchBrown,
                Block::RoofChurchGreen,
                Block::RoofChurchPurple,
                Block::RoofGableBeige,
                Block::RoofGableBrown,
                Block::RoofGableGreen,
                Block::RoofGablePurple,
                Block::RoofPointBeige,
                Block::RoofPointBrown,
                Block::RoofPointGreen,
                Block::RoofPointPurple,
                Block::RoofRoundBeige,
                Block::RoofRoundBrown,
                Block::RoofRoundGreen,
                Block::RoofRoundPurple,
                Block::RoofRoundedBeige,
                Block::RoofRoundedBrown,
                Block::RoofRoundedGreen,
                Block::RoofRoundedPurple,
                Block::RoofSlantBeige,
                Block::RoofSlantBrown,
                Block::RoofSlantGreen,
                Block::RoofSlantPurple,
            ],
            Category::Plants => vec![

                Block::RocksDirt,
                Block::RocksGrass,
                Block::Trees,
                Block::Tree,
            ],
            Category::Water => vec![

                Block::GrassRiver,
                Block::GrassRiverBend,
                Block::GrassRiverBridge,
                Block::GrassRiverCorner,
                Block::GrassRiverCrossing,
                Block::GrassRiverEnd,
                Block::GrassRiverEndSquare,
                Block::GrassRiverSlope,
                Block::GrassRiverSplit,
                Block::GrassWater,
                Block::GrassWaterConcave,
                Block::GrassWaterConvex,
                Block::GrassWaterRiver,
                Block::WaterCenter,
                Block::WaterFall
            ],
            Category::Other => vec![

            Category::Wood => vec![
                Block::Bridge,
                Block::StructureArch,
                Block::StructureHigh,
                Block::StructureLow,
            ],
            Category::All => Block::all()
        }