|
|
@ -172,6 +172,7 @@ impl ActiveItemDatabase { |
|
|
|
#[cfg(test)]
|
|
|
|
mod test {
|
|
|
|
use super::*;
|
|
|
|
use crate::entity::character::CharacterEntityId;
|
|
|
|
use crate::entity::item;
|
|
|
|
use crate::entity::item::{Item, ItemDetail, ItemEntityId, ItemLocation};
|
|
|
|
#[test]
|
|
|
@ -179,7 +180,7 @@ mod test { |
|
|
|
let item1 = Item {
|
|
|
|
id: ItemEntityId(1),
|
|
|
|
location: ItemLocation::Inventory {
|
|
|
|
character_id: 0,
|
|
|
|
character_id: CharacterEntityId(0),
|
|
|
|
index: 0,
|
|
|
|
equipped: false,
|
|
|
|
},
|
|
|
@ -194,7 +195,7 @@ mod test { |
|
|
|
let item2 = Item {
|
|
|
|
id: ItemEntityId(2),
|
|
|
|
location: ItemLocation::Inventory {
|
|
|
|
character_id: 0,
|
|
|
|
character_id: CharacterEntityId(0),
|
|
|
|
index: 1,
|
|
|
|
equipped: false,
|
|
|
|
},
|
|
|
@ -205,7 +206,7 @@ mod test { |
|
|
|
let item3 = Item {
|
|
|
|
id: ItemEntityId(3),
|
|
|
|
location: ItemLocation::Inventory {
|
|
|
|
character_id: 0,
|
|
|
|
character_id: CharacterEntityId(0),
|
|
|
|
index: 2,
|
|
|
|
equipped: false,
|
|
|
|
},
|
|
|
@ -220,7 +221,7 @@ mod test { |
|
|
|
let item4 = Item {
|
|
|
|
id: ItemEntityId(4),
|
|
|
|
location: ItemLocation::Inventory {
|
|
|
|
character_id: 0,
|
|
|
|
character_id: CharacterEntityId(0),
|
|
|
|
index: 1,
|
|
|
|
equipped: false,
|
|
|
|
},
|
|
|
@ -231,7 +232,7 @@ mod test { |
|
|
|
let item5 = Item {
|
|
|
|
id: ItemEntityId(5),
|
|
|
|
location: ItemLocation::Inventory {
|
|
|
|
character_id: 0,
|
|
|
|
character_id: CharacterEntityId(0),
|
|
|
|
index: 1,
|
|
|
|
equipped: false,
|
|
|
|
},
|
|
|
@ -242,7 +243,7 @@ mod test { |
|
|
|
let item6 = Item {
|
|
|
|
id: ItemEntityId(6),
|
|
|
|
location: ItemLocation::Inventory {
|
|
|
|
character_id: 0,
|
|
|
|
character_id: CharacterEntityId(0),
|
|
|
|
index: 3,
|
|
|
|
equipped: false,
|
|
|
|
},
|
|
|
@ -257,7 +258,7 @@ mod test { |
|
|
|
let item7 = Item {
|
|
|
|
id: ItemEntityId(7),
|
|
|
|
location: ItemLocation::Inventory {
|
|
|
|
character_id: 0,
|
|
|
|
character_id: CharacterEntityId(0),
|
|
|
|
index: 4,
|
|
|
|
equipped: false,
|
|
|
|
},
|
|
|
@ -268,7 +269,7 @@ mod test { |
|
|
|
let item8 = Item {
|
|
|
|
id: ItemEntityId(8),
|
|
|
|
location: ItemLocation::Inventory {
|
|
|
|
character_id: 0,
|
|
|
|
character_id: CharacterEntityId(0),
|
|
|
|
index: 4,
|
|
|
|
equipped: false,
|
|
|
|
},
|
|
|
@ -279,7 +280,7 @@ mod test { |
|
|
|
let item9 = Item {
|
|
|
|
id: ItemEntityId(9),
|
|
|
|
location: ItemLocation::Inventory {
|
|
|
|
character_id: 0,
|
|
|
|
character_id: CharacterEntityId(0),
|
|
|
|
index: 4,
|
|
|
|
equipped: false,
|
|
|
|
},
|
|
|
|