|
@ -280,6 +280,7 @@ mod test { |
|
|
|
|
|
|
|
|
#[test]
|
|
|
#[test]
|
|
|
fn test_create_bytes_from_esweapon() {
|
|
|
fn test_create_bytes_from_esweapon() {
|
|
|
|
|
|
// PSYCHO WAND + 72 (Chaos)
|
|
|
let testweapon = ESWeapon {
|
|
|
let testweapon = ESWeapon {
|
|
|
esweapon: ESWeaponType::Wand,
|
|
|
esweapon: ESWeaponType::Wand,
|
|
|
special: Some(ESWeaponSpecial::Chaos),
|
|
|
special: Some(ESWeaponSpecial::Chaos),
|
|
@ -289,4 +290,19 @@ mod test { |
|
|
let bytes = testweapon.as_bytes();
|
|
|
let bytes = testweapon.as_bytes();
|
|
|
assert_eq!(bytes, [0x00, 0x7B, 0x09, 0x48, 0x00, 0x00, 0x82, 0x13, 0xE4, 0x68, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x00]);
|
|
|
assert_eq!(bytes, [0x00, 0x7B, 0x09, 0x48, 0x00, 0x00, 0x82, 0x13, 0xE4, 0x68, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x00]);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
|
fn test_create_bytes_from_higher_esweapon_type() {
|
|
|
|
|
|
// YUGIOH CARDS + 105 (Spirit)
|
|
|
|
|
|
let testweapon = ESWeapon {
|
|
|
|
|
|
esweapon: ESWeaponType::Cards,
|
|
|
|
|
|
special: Some(ESWeaponSpecial::Spirit),
|
|
|
|
|
|
grind: 105u8,
|
|
|
|
|
|
name: "YUGIOH".to_owned(),
|
|
|
|
|
|
};
|
|
|
|
|
|
let bytes = testweapon.as_bytes();
|
|
|
|
|
|
assert_eq!(bytes, [0x00, 0xA7, 0x0B, 0x69, 0x00, 0x00, 0x83, 0x35, 0x9D, 0x2F, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00]);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
}
|