|
|
@ -26,9 +26,8 @@ use veccell::{VecRef, VecRefMut};
|
|
|
|
Here is how you would implement a simple "counter" tile:
|
|
|
|
Here is how you would implement a simple "counter" tile:
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
```
|
|
|
|
# use stackline::{*, tile::*, context::*};
|
|
|
|
# use stackline::tile::prelude::*;
|
|
|
|
#
|
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
|
|
|
#[derive(Clone, Debug)]
|
|
|
|
|
|
|
|
pub struct CounterTile(usize);
|
|
|
|
pub struct CounterTile(usize);
|
|
|
|
|
|
|
|
|
|
|
|
impl CounterTile {
|
|
|
|
impl CounterTile {
|
|
|
@ -113,8 +112,8 @@ impl<'a> UpdateContext<'a> {
|
|
|
|
/// # Example
|
|
|
|
/// # Example
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// ```
|
|
|
|
/// ```
|
|
|
|
/// # use stackline::prelude::*;
|
|
|
|
/// # use stackline::tile::prelude::*;
|
|
|
|
/// # #[derive(Clone, Debug)]
|
|
|
|
/// # #[derive(Clone, Debug, Serialize, Deserialize)]
|
|
|
|
/// # pub struct MyTile;
|
|
|
|
/// # pub struct MyTile;
|
|
|
|
/// # impl Tile for MyTile {
|
|
|
|
/// # impl Tile for MyTile {
|
|
|
|
/// fn update<'b>(&'b mut self, mut ctx: UpdateContext<'b>) {
|
|
|
|
/// fn update<'b>(&'b mut self, mut ctx: UpdateContext<'b>) {
|
|
|
@ -166,8 +165,8 @@ impl<'a> UpdateContext<'a> {
|
|
|
|
/// # Example
|
|
|
|
/// # Example
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// ```
|
|
|
|
/// ```
|
|
|
|
/// # use stackline::prelude::*;
|
|
|
|
/// # use stackline::tile::prelude::*;
|
|
|
|
/// #[derive(Clone, Debug)]
|
|
|
|
/// #[derive(Clone, Debug, Serialize, Deserialize)]
|
|
|
|
/// pub struct PrintTile;
|
|
|
|
/// pub struct PrintTile;
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// impl Tile for PrintTile {
|
|
|
|
/// impl Tile for PrintTile {
|
|
|
@ -278,8 +277,8 @@ impl<'a> UpdateContext<'a> {
|
|
|
|
/// # Example
|
|
|
|
/// # Example
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// ```
|
|
|
|
/// ```
|
|
|
|
/// # use stackline::prelude::*;
|
|
|
|
/// # use stackline::tile::prelude::*;
|
|
|
|
/// # #[derive(Clone, Debug)]
|
|
|
|
/// # #[derive(Clone, Debug, Serialize, Deserialize)]
|
|
|
|
/// # pub struct MyTile;
|
|
|
|
/// # pub struct MyTile;
|
|
|
|
/// # impl Tile for MyTile {
|
|
|
|
/// # impl Tile for MyTile {
|
|
|
|
/// fn update<'b>(&'b mut self, mut ctx: UpdateContext<'b>) {
|
|
|
|
/// fn update<'b>(&'b mut self, mut ctx: UpdateContext<'b>) {
|
|
|
@ -382,8 +381,8 @@ impl<'a> UpdateContext<'a> {
|
|
|
|
/// # Example
|
|
|
|
/// # Example
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// ```
|
|
|
|
/// ```
|
|
|
|
/// # use stackline::prelude::*;
|
|
|
|
/// # use stackline::tile::prelude::*;
|
|
|
|
/// #[derive(Clone, Debug)]
|
|
|
|
/// #[derive(Clone, Debug, Serialize, Deserialize)]
|
|
|
|
/// pub struct StorageTile {};
|
|
|
|
/// pub struct StorageTile {};
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// impl Tile for StorageTile {
|
|
|
|
/// impl Tile for StorageTile {
|
|
|
|