|
@ -1,14 +1,11 @@ |
|
|
use crate::ship::items::ClientItemId;
|
|
|
use crate::ship::items::ClientItemId;
|
|
|
use std::collections::{HashMap, BTreeMap, BinaryHeap};
|
|
|
|
|
|
use std::cmp::{Ordering, PartialOrd, PartialEq};
|
|
|
|
|
|
|
|
|
use std::collections::{HashMap, BTreeMap};
|
|
|
use thiserror::Error;
|
|
|
use thiserror::Error;
|
|
|
use futures::future::join_all;
|
|
|
|
|
|
use libpso::character::character;//::InventoryItem;
|
|
|
|
|
|
use crate::entity::gateway::EntityGateway;
|
|
|
use crate::entity::gateway::EntityGateway;
|
|
|
use crate::entity::character::{CharacterEntity, CharacterEntityId};
|
|
|
use crate::entity::character::{CharacterEntity, CharacterEntityId};
|
|
|
use crate::entity::item::{ItemEntityId, ItemEntity, ItemDetail, ItemLocation, BankName};
|
|
|
|
|
|
|
|
|
use crate::entity::item::{ItemDetail, ItemLocation, BankName};
|
|
|
use crate::entity::item::{Meseta, NewItemEntity};
|
|
|
use crate::entity::item::{Meseta, NewItemEntity};
|
|
|
use crate::entity::item::tool::{Tool, ToolType};
|
|
|
|
|
|
|
|
|
use crate::entity::item::tool::Tool;
|
|
|
use crate::ship::map::MapArea;
|
|
|
use crate::ship::map::MapArea;
|
|
|
use crate::ship::ship::ItemDropLocation;
|
|
|
use crate::ship::ship::ItemDropLocation;
|
|
|
use crate::ship::drops::{ItemDrop, ItemDropType};
|
|
|
use crate::ship::drops::{ItemDrop, ItemDropType};
|
|
@ -117,7 +114,7 @@ impl ItemManager { |
|
|
})
|
|
|
})
|
|
|
.into_iter()
|
|
|
.into_iter()
|
|
|
.map(|(bank_name, bank_items)| {
|
|
|
.map(|(bank_name, bank_items)| {
|
|
|
let mut stacked_bank_items = bank_items.into_iter()
|
|
|
|
|
|
|
|
|
let stacked_bank_items = bank_items.into_iter()
|
|
|
.fold(Vec::new(), |mut acc, (id, bank_item)| {
|
|
|
.fold(Vec::new(), |mut acc, (id, bank_item)| {
|
|
|
if bank_item.is_stackable() {
|
|
|
if bank_item.is_stackable() {
|
|
|
let existing_item = acc.iter_mut()
|
|
|
let existing_item = acc.iter_mut()
|
|
@ -513,19 +510,19 @@ impl ItemManager { |
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
pub async fn player_deposits_item<EG: EntityGateway>(&mut self,
|
|
|
pub async fn player_deposits_item<EG: EntityGateway>(&mut self,
|
|
|
entity_gateway: &mut EG,
|
|
|
|
|
|
character: &CharacterEntity,
|
|
|
|
|
|
item_id: ClientItemId,
|
|
|
|
|
|
amount: usize)
|
|
|
|
|
|
|
|
|
_entity_gateway: &mut EG,
|
|
|
|
|
|
_character: &CharacterEntity,
|
|
|
|
|
|
_item_id: ClientItemId,
|
|
|
|
|
|
_amount: usize)
|
|
|
-> Result<(), ItemManagerError> {
|
|
|
-> Result<(), ItemManagerError> {
|
|
|
Ok(())
|
|
|
Ok(())
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
pub async fn player_withdraws_item<EG: EntityGateway>(&mut self,
|
|
|
pub async fn player_withdraws_item<EG: EntityGateway>(&mut self,
|
|
|
entity_gateway: &mut EG,
|
|
|
|
|
|
character: &CharacterEntity,
|
|
|
|
|
|
item_id: ClientItemId,
|
|
|
|
|
|
amount: usize)
|
|
|
|
|
|
|
|
|
_entity_gateway: &mut EG,
|
|
|
|
|
|
_character: &CharacterEntity,
|
|
|
|
|
|
_item_id: ClientItemId,
|
|
|
|
|
|
_amount: usize)
|
|
|
-> Result<(), ItemManagerError> {
|
|
|
-> Result<(), ItemManagerError> {
|
|
|
Ok(())
|
|
|
Ok(())
|
|
|
}
|
|
|
}
|
|
|