bitsy-parser/src/mocks.rs

70 lines
1.8 KiB
Rust
Raw Normal View History

2020-04-12 11:48:07 +00:00
use crate::{Avatar, Position};
use crate::image::Image;
pub mod image {
use crate::image::Image;
pub(crate) fn chequers_1() -> Image {
Image {
pixels: vec![
1, 0, 1, 0, 1, 0, 1, 0,
0, 1, 0, 1, 0, 1, 0, 1,
1, 0, 1, 0, 1, 0, 1, 0,
0, 1, 0, 1, 0, 1, 0, 1,
1, 0, 1, 0, 1, 0, 1, 0,
0, 1, 0, 1, 0, 1, 0, 1,
1, 0, 1, 0, 1, 0, 1, 0,
0, 1, 0, 1, 0, 1, 0, 1,
]
}
}
pub fn chequers_2() -> Image {
Image {
pixels: vec![
0,1,0,1,0,1,0,1,
1,0,1,0,1,0,1,0,
0,1,0,1,0,1,0,1,
1,0,1,0,1,0,1,0,
0,1,0,1,0,1,0,1,
1,0,1,0,1,0,1,0,
0,1,0,1,0,1,0,1,
1,0,1,0,1,0,1,0,
]
}
}
}
pub fn avatar() -> Avatar {
Avatar {
animation_frames: vec![
Image {
pixels: vec![
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,1,1,1,1,1,1,0,
1,1,1,0,1,1,1,0,
1,0,0,1,1,0,0,1,
1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,
0,1,1,1,1,1,1,0,
]
},
Image {
pixels: vec![
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,1,1,1,1,1,1,0,
1,1,1,0,1,1,1,0,
1,0,0,1,1,0,0,1,
1,1,1,1,1,1,1,1,
0,1,1,1,0,1,1,0,
]
},
],
room: "0".to_string(),
position: Position { x: 2, y: 5 }
}
}