This module contains the Tile
trait, allowing to represent other data types as tile,
or more specifically as StyledContent<&'static str>
, provided by the crossterm
crate,
and the TileMap<T>
type, representing a tilemap of T
, where T
: Tile
+ Default
,
which is based on the GridMap<V>
from grid-math
crate, which is a wrapper around the HashMap<Cell, V>
.
Note:
- Crate is in the "work in progress" state, so the public API may change in the future. Feel free to contribute!
use ;
use ;
use Cell;
use stdout;
// declare Entity enum
// represent Entity as tile
This will create new TileMap<Entity>
, fill it with some instances of Entity
, and then draw
it to the stdout
:
Note:
- `TileMap` type is based on the `GridMap` type, provided by the `grid-math` crate,
so to get more detailed explanation about `Cell`, `Grid`, and `GridMap` types, visit it's documentation.
- Also, to get more information about `StyledContent` type, `Stylize` trait, visit `crossterm` documentation.
For more examples, visit cli-tilemap
documentation on https://docs.rs/cli-tilemap/latest/cli_tilemap/ Crab Crab! 🦀🦀