pub trait UnitPainter<U> {
// Required method
fn paint(&self, scene: &MapScene<U>, grid: &Grid, buf: &mut GlyphBuffer);
// Provided methods
fn paint_under(
&self,
_scene: &MapScene<U>,
_grid: &Grid,
_buf: &mut GlyphBuffer,
) { ... }
fn paint_over(
&self,
_scene: &MapScene<U>,
_grid: &Grid,
_buf: &mut GlyphBuffer,
) { ... }
}Expand description
Paints a game’s units on a grid skin’s tiles: its letters, bars, marks or pictures (game ADR-0038). A skin calls it between its own layers.
Required Methods§
Sourcefn paint(&self, scene: &MapScene<U>, grid: &Grid, buf: &mut GlyphBuffer)
fn paint(&self, scene: &MapScene<U>, grid: &Grid, buf: &mut GlyphBuffer)
The units of scene on grid’s tiles: after the path’s line (on
the glyph skin, after the ground), before its arrowhead and the
cursor.
Provided Methods§
Sourcefn paint_under(
&self,
_scene: &MapScene<U>,
_grid: &Grid,
_buf: &mut GlyphBuffer,
)
fn paint_under( &self, _scene: &MapScene<U>, _grid: &Grid, _buf: &mut GlyphBuffer, )
What lies on the ground under the units (a light square under a unit picked out): painted after the ground and the ranges, before the path’s line. Nothing unless the painter says.
Sourcefn paint_over(&self, _scene: &MapScene<U>, _grid: &Grid, _buf: &mut GlyphBuffer)
fn paint_over(&self, _scene: &MapScene<U>, _grid: &Grid, _buf: &mut GlyphBuffer)
What lies over the units and under the cursor (marks at the edges
the map goes on past, MapScene::more): painted after the units
and the path, before the cursor and the threat arrows. Nothing
unless the painter says.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".