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

@@ -1,9 +1,9 @@
use crate::{from_base36, optional_data_line, AnimationFrames, Image, ToBase36};
use crate::{optional_data_line, AnimationFrames, Image};
use crate::image::animation_frames_from_string;
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Item {
pub id: u64,
pub id: String,
pub animation_frames: Vec<Image>,
pub name: Option<String>,
pub dialogue_id: Option<String>,
@@ -32,7 +32,7 @@ impl From<String> for Item {
fn from(string: String) -> Item {
let mut lines: Vec<&str> = string.lines().collect();
let id = from_base36(&lines[0].replace("ITM ", ""));
let id = lines[0].replace("ITM ", "");
let mut name = None;
let mut dialogue_id = None;
let mut colour_id: Option<u64> = None;
@@ -71,7 +71,7 @@ impl ToString for Item {
fn to_string(&self) -> String {
format!(
"ITM {}\n{}{}{}{}",
self.id.to_base36(),
self.id,
self.animation_frames.to_string(),
self.name_line(),
self.dialogue_line(),