Browse Source

add item_state to ShipState

pull/112/head
jake 2 years ago
committed by andy
parent
commit
b8de2ea8e6
  1. 21
      Cargo.lock
  2. 3
      src/ship/ship.rs

21
Cargo.lock

@ -597,6 +597,7 @@ dependencies = [
"derive_more",
"enum-utils",
"fern",
"fix-hidden-lifetime-bug",
"futures",
"lazy_static",
"libpso",
@ -679,6 +680,26 @@ dependencies = [
"log",
]
[[package]]
name = "fix-hidden-lifetime-bug"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4ae9c2016a663983d4e40a9ff967d6dcac59819672f0b47f2b17574e99c33c8"
dependencies = [
"fix-hidden-lifetime-bug-proc_macros",
]
[[package]]
name = "fix-hidden-lifetime-bug-proc_macros"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4c81935e123ab0741c4c4f0d9b8377e5fb21d3de7e062fa4b1263b1fbcba1ea"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "foreign-types"
version = "0.3.2"

3
src/ship/ship.rs

@ -62,6 +62,7 @@ pub enum ShipError {
PickUpInvalidItemId(u32),
DropInvalidItemId(u32),
ItemManagerError(#[from] items::ItemManagerError),
ItemStateError(#[from] items::state::ItemStateError),
#[error("")]
ItemDropLocationNotSet,
BoxAlreadyDroppedItem(ClientId, u16),
@ -406,6 +407,7 @@ impl<EG: EntityGateway> ShipServerStateBuilder<EG> {
level_table: CharacterLevelTable::default(),
name: self.name.unwrap_or_else(|| "NAMENOTSET".into()),
item_manager: items::ItemManager::default(),
item_state: items::state::ItemState::default(),
ip: self.ip.unwrap_or_else(|| Ipv4Addr::new(127,0,0,1)),
port: self.port.unwrap_or(SHIP_PORT),
shops: Box::new(ItemShops::default()),
@ -450,6 +452,7 @@ pub struct ShipServerState<EG: EntityGateway> {
level_table: CharacterLevelTable,
name: String,
item_manager: items::ItemManager,
item_state: items::state::ItemState,
shops: Box<ItemShops>,
pub blocks: Blocks,

Loading…
Cancel
Save