#vec #2d #vec2d #2d-vector #vector #gamefield

board

A simple crate for creating a single vector with coordinate based access, and a few nice functions for easy use

5 releases

0.2.2 Jan 10, 2021
0.2.1 Jan 10, 2021
0.2.0 Jan 8, 2021
0.1.1 Jan 6, 2021
0.1.0 Jan 6, 2021

#1538 in Data structures

21 downloads per month

Apache-2.0

12KB
173 lines

A simple crate for creating a single vector with coordinate based access, and a few nice functions for easy use.

Link to docs Link to crates.io


lib.rs:

A simple Vec wrapper that is accessible as if it were a 2d vector. Implements Index<(x, y)> and IndexMut<(x, y)>.

The underlying Vec is only mutably accessible through methods of Vec2d. If you want ownership of Vec, consume the Vec2d with to_vec.

Dependencies

~0.4–1MB
~22K SLoC