Skip to main content

generate_piece_weighted

Function generate_piece_weighted 

Source
fn generate_piece_weighted(
    is_castle: bool,
    builder: &mut Builder,
    rng: &mut LegacyRandom,
    foot: IVec3,
    dir: Direction,
    depth: i32,
) -> Option<FortressPiece>
Expand description

Vanilla’s generatePiece. Falls back to BridgeEndFiller if no weighted pick succeeds within 5 attempts. On ineligible picks vanilla falls through to subsequent pieces in the list.