convert int IDs to strings

This commit is contained in:
2020-06-18 14:44:20 +01:00
parent e895f932a6
commit fe6f3f5c84
7 changed files with 57 additions and 56 deletions

View File

@@ -84,7 +84,7 @@ pub mod image {
#[inline]
pub fn avatar() -> Sprite {
Sprite {
id: 0,
id: "0".to_string(),
animation_frames: vec![
Image {
pixels: vec![
@@ -102,7 +102,7 @@ pub fn avatar() -> Sprite {
},
],
name: None,
room_id: Some(0),
room_id: Some("0".to_string()),
position: Some(Position { x: 2, y: 5 }),
colour_id: None,
dialogue_id: None,
@@ -130,7 +130,7 @@ pub fn tile_default() -> Tile {
#[inline]
pub fn sprite() -> Sprite {
Sprite {
id: 10,
id: "a".to_string(),
name: Some("hatch".to_string()),
animation_frames: vec![Image {
pixels: vec![
@@ -140,7 +140,7 @@ pub fn sprite() -> Sprite {
],
}],
dialogue_id: Some("SPR_0".to_string()),
room_id: Some(4),
room_id: Some("4".to_string()),
position: Some(Position { x: 9, y: 7 }),
colour_id: None,
items: vec![]
@@ -150,7 +150,7 @@ pub fn sprite() -> Sprite {
#[inline]
pub fn item() -> Item {
Item {
id: 6,
id: "6".to_string(),
animation_frames: vec![Image {
pixels: vec![
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -167,8 +167,8 @@ pub fn item() -> Item {
#[inline]
pub fn room() -> Room {
Room {
id: 10,
palette_id: Some(9),
id: "a".to_string(),
palette_id: Some("9".to_string()),
name: Some("cellar 7".to_string()),
tiles: vec![
"0".to_string(),
@@ -453,7 +453,7 @@ pub fn room() -> Room {
exits: vec![ExitInstance {
position: Position { x: 3, y: 3 },
exit: Exit {
room_id: 3,
room_id: "3".to_string(),
position: Position { x: 10, y: 6 },
effect: Transition::None,
},
@@ -479,7 +479,7 @@ pub fn game_default() -> Game {
custom_font: None,
text_direction: TextDirection::LeftToRight,
palettes: vec![Palette {
id: 0,
id: "0".to_string(),
name: None,
colours: vec![
Colour {
@@ -500,8 +500,8 @@ pub fn game_default() -> Game {
],
}],
rooms: vec![Room {
id: 0,
palette_id: Some(0),
id: "0".to_string(),
palette_id: Some("0".to_string()),
name: None,
tiles: vec![
"0".to_string(),
@@ -768,7 +768,7 @@ pub fn game_default() -> Game {
}],
tiles: vec![self::tile_default()],
avatar: Sprite {
id: 10,
id: "A".to_string(),
animation_frames: vec![Image {
pixels: vec![
0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0,
@@ -777,14 +777,14 @@ pub fn game_default() -> Game {
],
}],
name: None,
room_id: Some(0),
room_id: Some("0".to_string()),
position: Option::from(Position { x: 4, y: 4 }),
colour_id: None,
dialogue_id: None,
items: vec![]
},
sprites: vec![Sprite {
id: 10,
id: "a".to_string(),
name: None,
animation_frames: vec![Image {
pixels: vec![
@@ -794,13 +794,13 @@ pub fn game_default() -> Game {
],
}],
dialogue_id: Some("SPR_0".to_string()),
room_id: Some(0),
room_id: Some("0".to_string()),
position: Some(Position { x: 8, y: 12 }),
colour_id: None,
items: vec![]
}],
items: vec![Item {
id: 0,
id: "0".to_string(),
animation_frames: vec![Image {
pixels: vec![
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,