Struct sqrid::Sqrid[][src]

pub struct Sqrid<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> {}
Expand description

Sqrid base “factory” type

This struct holds all the generic const parameters required by the other structs. This can be aliased and used as a pseudo-module to ease the creation of the other entites and use of algorithms like BFS.

Implementations

Width of the grid: exclusive max of the x coordinate.

Height of the grid: exclusive max of the y coordinate.

Create new breadth-first iterator

This is used to iterate coordinates in breadth-first order, from a given origin, using a provided function to evaluate a given Qa position + Qr direction into the next Qa position.

Example usage:

type Sqrid = sqrid::sqrid_create!(3, 3, false);
type Qa = sqrid::qa_create!(Sqrid);

for (qa, qr) in Sqrid::bf_iter(sqrid::qaqr_eval, &Qa::CENTER)
                .flatten() {
    println!("breadth-first qa {} from {}", qa, qr);
}

Perform a breadth-first search; see search_qrgrid

Perform a breadth-first search; see search_path

Perform an A* search; see search_path

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.