mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Eradicated clones
This commit is contained in:
@ -22,6 +22,31 @@ pub enum InventoryManip {
|
||||
CraftRecipe(String),
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum LoadoutManip {
|
||||
Swap(Slot, Slot),
|
||||
Drop(Slot),
|
||||
}
|
||||
|
||||
impl From<LoadoutManip> for InventoryManip {
|
||||
fn from(loadout_manip: LoadoutManip) -> Self {
|
||||
match loadout_manip {
|
||||
LoadoutManip::Swap(slot1, slot2) => Self::Swap(slot1, slot2),
|
||||
LoadoutManip::Drop(slot) => Self::Drop(slot),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<InventoryManip> for Option<LoadoutManip> {
|
||||
fn from(inv_manip: InventoryManip) -> Self {
|
||||
match inv_manip {
|
||||
InventoryManip::Swap(slot1, slot2) => Some(LoadoutManip::Swap(slot1, slot2)),
|
||||
InventoryManip::Drop(slot) => Some(LoadoutManip::Drop(slot)),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum GroupManip {
|
||||
Invite(Uid),
|
||||
@ -46,10 +71,10 @@ pub enum ControlEvent {
|
||||
Respawn,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum ControlAction {
|
||||
SwapLoadout,
|
||||
ModifyLoadout(InventoryManip),
|
||||
ModifyLoadout(Option<LoadoutManip>),
|
||||
Wield,
|
||||
GlideWield,
|
||||
Unwield,
|
||||
|
Reference in New Issue
Block a user