use crate::macros::wrap;
use servicepoint::{Cp437Grid, Cp437GridCommand, Origin};
use std::ptr::NonNull;
wrap!(
Cp437GridCommand {
derives: crate::commands::derive_command[Cp437Grid], crate::commands::derive_origin_accessors;
properties:
prop grid: Cp437Grid { get mut; set move; };
functions:
fn new(
grid: move NonNull<Cp437Grid>,
origin_x: val usize,
origin_y: val usize,
) -> move NonNull<Cp437GridCommand> {
Cp437GridCommand {
grid,
origin: Origin::new(origin_x, origin_y),
}
};
fn from_grid(grid: move NonNull<Cp437Grid>) -> move NonNull<Cp437GridCommand> {
grid.into()
};
}
);