From a74672b3f76275ebb8fcd8e0d213e3e7ead6b36c Mon Sep 17 00:00:00 2001 From: Erik Hofmayer Date: Fri, 15 Jan 2021 15:46:53 +0100 Subject: [PATCH 1/3] Added resource_types macro and new resources --- src/websocket/types/room/resources.rs | 413 ++++++++++++++------------ 1 file changed, 219 insertions(+), 194 deletions(-) diff --git a/src/websocket/types/room/resources.rs b/src/websocket/types/room/resources.rs index 7e354f4..89eaa83 100644 --- a/src/websocket/types/room/resources.rs +++ b/src/websocket/types/room/resources.rs @@ -8,204 +8,229 @@ use serde::{ use crate::websocket::room_object_macros::Updatable; -/// All possible resource identifiers in the game. -#[derive(Serialize, Deserialize, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] -pub enum ResourceType { - /// RESOURCE_ENERGY: "energy", - #[serde(rename = "energy")] - Energy, - /// RESOURCE_POWER: "power", - #[serde(rename = "power")] - Power, - /// RESOURCE_HYDROGEN: "H", - #[serde(rename = "H")] - Hydrogen, - /// RESOURCE_OXYGEN: "O", - #[serde(rename = "O")] - Oxygen, - /// RESOURCE_UTRIUM: "U", - #[serde(rename = "U")] - Utrium, - /// RESOURCE_LEMERGIUM: "L", - #[serde(rename = "L")] - Lemergium, - /// RESOURCE_KEANIUM: "K", - #[serde(rename = "K")] - Keanium, - /// RESOURCE_ZYNTHIUM: "Z", - #[serde(rename = "Z")] - Zynthium, - /// RESOURCE_CATALYST: "X", - #[serde(rename = "X")] - Catalyst, - /// RESOURCE_GHODIUM: "G", - #[serde(rename = "G")] - Ghodium, - /// RESOURCE_HYDROXIDE: "OH", - #[serde(rename = "OH")] - Hydroxide, - /// RESOURCE_ZYNTHIUM_KEANITE: "ZK", - #[serde(rename = "ZK")] - ZynthiumKeanite, - /// RESOURCE_UTRIUM_LEMERGITE: "UL", - #[serde(rename = "UL")] - UtriumLemergite, - /// RESOURCE_UTRIUM_HYDRIDE: "UH", - #[serde(rename = "UH")] - UtriumHydride, - /// RESOURCE_UTRIUM_OXIDE: "UO", - #[serde(rename = "UO")] - UtriumOxide, - /// RESOURCE_KEANIUM_HYDRIDE: "KH", - #[serde(rename = "KH")] - KeaniumHydride, - /// RESOURCE_KEANIUM_OXIDE: "KO", - #[serde(rename = "KO")] - KeaniumOxide, - /// RESOURCE_LEMERGIUM_HYDRIDE: "LH", - #[serde(rename = "LH")] - LemergiumHydride, - /// RESOURCE_LEMERGIUM_OXIDE: "LO", - #[serde(rename = "LO")] - LemergiumOxide, - /// RESOURCE_ZYNTHIUM_HYDRIDE: "ZH", - #[serde(rename = "ZH")] - ZynthiumHydride, - /// RESOURCE_ZYNTHIUM_OXIDE: "ZO", - #[serde(rename = "ZO")] - ZynthiumOxide, - /// RESOURCE_GHODIUM_HYDRIDE: "GH", - #[serde(rename = "GH")] - GhodiumHydride, - /// RESOURCE_GHODIUM_OXIDE: "GO", - #[serde(rename = "GO")] - GhodiumOxide, - /// RESOURCE_UTRIUM_ACID: "UH2O", - #[serde(rename = "UH2O")] - UtriumAcid, - /// RESOURCE_UTRIUM_ALKALIDE: "UHO2", - #[serde(rename = "UHO2")] - UtriumAlkalide, - /// RESOURCE_KEANIUM_ACID: "KH2O", - #[serde(rename = "KH2O")] - KeaniumAcid, - /// RESOURCE_KEANIUM_ALKALIDE: "KHO2", - #[serde(rename = "KHO2")] - KeaniumAlkalide, - /// RESOURCE_LEMERGIUM_ACID: "LH2O", - #[serde(rename = "LH2O")] - LemergiumAcid, - /// RESOURCE_LEMERGIUM_ALKALIDE: "LHO2", - #[serde(rename = "LHO2")] - LemergiumAlkalide, - /// RESOURCE_ZYNTHIUM_ACID: "ZH2O", - #[serde(rename = "ZH2O")] - ZynthiumAcid, - /// RESOURCE_ZYNTHIUM_ALKALIDE: "ZHO2", - #[serde(rename = "ZHO2")] - ZynthiumAlkalide, - /// RESOURCE_GHODIUM_ACID: "GH2O", - #[serde(rename = "GH2O")] - GhodiumAcid, - /// RESOURCE_GHODIUM_ALKALIDE: "GHO2", - #[serde(rename = "GHO2")] - GhodiumAlkalide, - /// RESOURCE_CATALYZED_UTRIUM_ACID: "XUH2O", - #[serde(rename = "XUH2O")] - CatalyzedUtriumAcid, - /// RESOURCE_CATALYZED_UTRIUM_ALKALIDE: "XUHO2", - #[serde(rename = "XUHO2")] - CatalyzedUtriumAlkalide, - /// RESOURCE_CATALYZED_KEANIUM_ACID: "XKH2O", - #[serde(rename = "XKH2O")] - CatalyzedKeaniumAcid, - /// RESOURCE_CATALYZED_KEANIUM_ALKALIDE: "XKHO2", - #[serde(rename = "XKHO2")] - CatalyzedKeaniumAlkalide, - /// RESOURCE_CATALYZED_LEMERGIUM_ACID: "XLH2O", - #[serde(rename = "XLH2O")] - CatalyzedLemergiumAcid, - /// RESOURCE_CATALYZED_LEMERGIUM_ALKALIDE: "XLHO2", - #[serde(rename = "XLHO2")] - CatalyzedLemergiumAlkalide, - /// RESOURCE_CATALYZED_ZYNTHIUM_ACID: "XZH2O", - #[serde(rename = "XZH2O")] - CatalyzedZynthiumAcid, - /// RESOURCE_CATALYZED_ZYNTHIUM_ALKALIDE: "XZHO2", - #[serde(rename = "XZHO2")] - CatalyzedZynthiumAlkalide, - /// RESOURCE_CATALYZED_GHODIUM_ACID: "XGH2O", - #[serde(rename = "XGH2O")] - CatalyzedGhodiumAcid, - /// RESOURCE_CATALYZED_GHODIUM_ALKALIDE: "XGHO2", - #[serde(rename = "XGHO2")] - CatalyzedGhodiumAlkalide, -} +macro_rules! resource_types { + ({ + $( + $(#[$attrs:meta])* + $name:ident: $repl:tt, + )* + }) => { + /// All possible resource identifiers in the game. + #[derive(Serialize, Deserialize, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[serde(rename_all = "camelCase")] + pub enum ResourceType { + $( + $(#[$attrs])* + #[serde(rename = $repl)] + $name, + )* + } + basic_updatable!(ResourceType); -basic_updatable!(ResourceType); - -impl ResourceType { - // created by replacing: - // `s#/// [A-Z_]+: "(\w+)",\n (\w+),#ResourceType::$2 => "$1",#g` - // (original is the definition for the enum) - - /// Finds the in-game resource type string for this resource type. - /// - /// Example: - /// - /// ``` - /// # use screeps_api::websocket::resources::ResourceType; - /// assert_eq!(ResourceType::Utrium.to_resource_string(), "U") - /// ``` - pub fn to_resource_string(&self) -> &'static str { - match *self { - ResourceType::Energy => "energy", - ResourceType::Power => "power", - ResourceType::Hydrogen => "H", - ResourceType::Oxygen => "O", - ResourceType::Utrium => "U", - ResourceType::Lemergium => "L", - ResourceType::Keanium => "K", - ResourceType::Zynthium => "Z", - ResourceType::Catalyst => "X", - ResourceType::Ghodium => "G", - ResourceType::Hydroxide => "OH", - ResourceType::ZynthiumKeanite => "ZK", - ResourceType::UtriumLemergite => "UL", - ResourceType::UtriumHydride => "UH", - ResourceType::UtriumOxide => "UO", - ResourceType::KeaniumHydride => "KH", - ResourceType::KeaniumOxide => "KO", - ResourceType::LemergiumHydride => "LH", - ResourceType::LemergiumOxide => "LO", - ResourceType::ZynthiumHydride => "ZH", - ResourceType::ZynthiumOxide => "ZO", - ResourceType::GhodiumHydride => "GH", - ResourceType::GhodiumOxide => "GO", - ResourceType::UtriumAcid => "UH2O", - ResourceType::UtriumAlkalide => "UHO2", - ResourceType::KeaniumAcid => "KH2O", - ResourceType::KeaniumAlkalide => "KHO2", - ResourceType::LemergiumAcid => "LH2O", - ResourceType::LemergiumAlkalide => "LHO2", - ResourceType::ZynthiumAcid => "ZH2O", - ResourceType::ZynthiumAlkalide => "ZHO2", - ResourceType::GhodiumAcid => "GH2O", - ResourceType::GhodiumAlkalide => "GHO2", - ResourceType::CatalyzedUtriumAcid => "XUH2O", - ResourceType::CatalyzedUtriumAlkalide => "XUHO2", - ResourceType::CatalyzedKeaniumAcid => "XKH2O", - ResourceType::CatalyzedKeaniumAlkalide => "XKHO2", - ResourceType::CatalyzedLemergiumAcid => "XLH2O", - ResourceType::CatalyzedLemergiumAlkalide => "XLHO2", - ResourceType::CatalyzedZynthiumAcid => "XZH2O", - ResourceType::CatalyzedZynthiumAlkalide => "XZHO2", - ResourceType::CatalyzedGhodiumAcid => "XGH2O", - ResourceType::CatalyzedGhodiumAlkalide => "XGHO2", + impl ResourceType { + /// Finds the in-game resource type string for this resource type. + /// + /// Example: + /// + /// ``` + /// # use screeps_api::websocket::resources::ResourceType; + /// assert_eq!(ResourceType::Utrium.to_resource_string(), "U") + /// ``` + pub fn to_resource_string(&self) -> &'static str { + match *self { + $( + ResourceType::$name => $repl, + )* + } + } } - } + }; } +resource_types!({ + /// RESOURCE_ENERGY: "energy" + RESOURCE_ENERGY: "energy", + /// RESOURCE_POWER: "power" + RESOURCE_POWER: "power", + + /// RESOURCE_HYDROGEN: "H" + RESOURCE_HYDROGEN: "H", + /// RESOURCE_OXYGEN: "O" + RESOURCE_OXYGEN: "O", + /// RESOURCE_UTRIUM: "U" + RESOURCE_UTRIUM: "U", + /// RESOURCE_LEMERGIUM: "L" + RESOURCE_LEMERGIUM: "L", + /// RESOURCE_KEANIUM: "K" + RESOURCE_KEANIUM: "K", + /// RESOURCE_ZYNTHIUM: "Z" + RESOURCE_ZYNTHIUM: "Z", + /// RESOURCE_CATALYST: "X" + RESOURCE_CATALYST: "X", + /// RESOURCE_GHODIUM: "G" + RESOURCE_GHODIUM: "G", + + /// RESOURCE_SILICON: "silicon" + RESOURCE_SILICON: "silicon", + /// RESOURCE_METAL: "metal" + RESOURCE_METAL: "metal", + /// RESOURCE_BIOMASS: "biomass" + RESOURCE_BIOMASS: "biomass", + /// RESOURCE_MIST: "mist" + RESOURCE_MIST: "mist", + + /// RESOURCE_HYDROXIDE: "OH" + RESOURCE_HYDROXIDE: "OH", + /// RESOURCE_ZYNTHIUM_KEANITE: "ZK" + RESOURCE_ZYNTHIUM_KEANITE: "ZK", + /// RESOURCE_UTRIUM_LEMERGITE: "UL" + RESOURCE_UTRIUM_LEMERGITE: "UL", + + /// RESOURCE_UTRIUM_HYDRIDE: "UH" + RESOURCE_UTRIUM_HYDRIDE: "UH", + /// RESOURCE_UTRIUM_OXIDE: "UO" + RESOURCE_UTRIUM_OXIDE: "UO", + /// RESOURCE_KEANIUM_HYDRIDE: "KH" + RESOURCE_KEANIUM_HYDRIDE: "KH", + /// RESOURCE_KEANIUM_OXIDE: "KO" + RESOURCE_KEANIUM_OXIDE: "KO", + /// RESOURCE_LEMERGIUM_HYDRIDE: "LH" + RESOURCE_LEMERGIUM_HYDRIDE: "LH", + /// RESOURCE_LEMERGIUM_OXIDE: "LO" + RESOURCE_LEMERGIUM_OXIDE: "LO", + /// RESOURCE_ZYNTHIUM_HYDRIDE: "ZH" + RESOURCE_ZYNTHIUM_HYDRIDE: "ZH", + /// RESOURCE_ZYNTHIUM_OXIDE: "ZO" + RESOURCE_ZYNTHIUM_OXIDE: "ZO", + /// RESOURCE_GHODIUM_HYDRIDE: "GH" + RESOURCE_GHODIUM_HYDRIDE: "GH", + /// RESOURCE_GHODIUM_OXIDE: "GO" + RESOURCE_GHODIUM_OXIDE: "GO", + + /// RESOURCE_UTRIUM_ACID: "UH2O" + RESOURCE_UTRIUM_ACID: "UH2O", + /// RESOURCE_UTRIUM_ALKALIDE: "UHO2" + RESOURCE_UTRIUM_ALKALIDE: "UHO2", + /// RESOURCE_KEANIUM_ACID: "KH2O" + RESOURCE_KEANIUM_ACID: "KH2O", + /// RESOURCE_KEANIUM_ALKALIDE: "KHO2" + RESOURCE_KEANIUM_ALKALIDE: "KHO2", + /// RESOURCE_LEMERGIUM_ACID: "LH2O" + RESOURCE_LEMERGIUM_ACID: "LH2O", + /// RESOURCE_LEMERGIUM_ALKALIDE: "LHO2" + RESOURCE_LEMERGIUM_ALKALIDE: "LHO2", + /// RESOURCE_ZYNTHIUM_ACID: "ZH2O" + RESOURCE_ZYNTHIUM_ACID: "ZH2O", + /// RESOURCE_ZYNTHIUM_ALKALIDE: "ZHO2" + RESOURCE_ZYNTHIUM_ALKALIDE: "ZHO2", + /// RESOURCE_GHODIUM_ACID: "GH2O" + RESOURCE_GHODIUM_ACID: "GH2O", + /// RESOURCE_GHODIUM_ALKALIDE: "GHO2" + RESOURCE_GHODIUM_ALKALIDE: "GHO2", + + /// RESOURCE_CATALYZED_UTRIUM_ACID: "XUH2O" + RESOURCE_CATALYZED_UTRIUM_ACID: "XUH2O", + /// RESOURCE_CATALYZED_UTRIUM_ALKALIDE: "XUHO2" + RESOURCE_CATALYZED_UTRIUM_ALKALIDE: "XUHO2", + /// RESOURCE_CATALYZED_KEANIUM_ACID: "XKH2O" + RESOURCE_CATALYZED_KEANIUM_ACID: "XKH2O", + /// RESOURCE_CATALYZED_KEANIUM_ALKALIDE: "XKHO2" + RESOURCE_CATALYZED_KEANIUM_ALKALIDE: "XKHO2", + /// RESOURCE_CATALYZED_LEMERGIUM_ACID: "XLH2O" + RESOURCE_CATALYZED_LEMERGIUM_ACID: "XLH2O", + /// RESOURCE_CATALYZED_LEMERGIUM_ALKALIDE: "XLHO2" + RESOURCE_CATALYZED_LEMERGIUM_ALKALIDE: "XLHO2", + /// RESOURCE_CATALYZED_ZYNTHIUM_ACID: "XZH2O" + RESOURCE_CATALYZED_ZYNTHIUM_ACID: "XZH2O", + /// RESOURCE_CATALYZED_ZYNTHIUM_ALKALIDE: "XZHO2" + RESOURCE_CATALYZED_ZYNTHIUM_ALKALIDE: "XZHO2", + /// RESOURCE_CATALYZED_GHODIUM_ACID: "XGH2O" + RESOURCE_CATALYZED_GHODIUM_ACID: "XGH2O", + /// RESOURCE_CATALYZED_GHODIUM_ALKALIDE: "XGHO2" + RESOURCE_CATALYZED_GHODIUM_ALKALIDE: "XGHO2", + + /// RESOURCE_OPS: "ops" + RESOURCE_OPS: "ops", + + /// RESOURCE_UTRIUM_BAR: "utrium_bar" + RESOURCE_UTRIUM_BAR: "utrium_bar", + /// RESOURCE_LEMERGIUM_BAR: "lemergium_bar" + RESOURCE_LEMERGIUM_BAR: "lemergium_bar", + /// RESOURCE_ZYNTHIUM_BAR: "zynthium_bar" + RESOURCE_ZYNTHIUM_BAR: "zynthium_bar", + /// RESOURCE_KEANIUM_BAR: "keanium_bar" + RESOURCE_KEANIUM_BAR: "keanium_bar", + /// RESOURCE_GHODIUM_MELT: "ghodium_melt" + RESOURCE_GHODIUM_MELT: "ghodium_melt", + /// RESOURCE_OXIDANT: "oxidant" + RESOURCE_OXIDANT: "oxidant", + /// RESOURCE_REDUCTANT: "reductant" + RESOURCE_REDUCTANT: "reductant", + /// RESOURCE_PURIFIER: "purifier" + RESOURCE_PURIFIER: "purifier", + /// RESOURCE_BATTERY: "battery" + RESOURCE_BATTERY: "battery", + + /// RESOURCE_COMPOSITE: "composite" + RESOURCE_COMPOSITE: "composite", + /// RESOURCE_CRYSTAL: "crystal" + RESOURCE_CRYSTAL: "crystal", + /// RESOURCE_LIQUID: "liquid" + RESOURCE_LIQUID: "liquid", + + /// RESOURCE_WIRE: "wire" + RESOURCE_WIRE: "wire", + /// RESOURCE_SWITCH: "switch" + RESOURCE_SWITCH: "switch", + /// RESOURCE_TRANSISTOR: "transistor" + RESOURCE_TRANSISTOR: "transistor", + /// RESOURCE_MICROCHIP: "microchip" + RESOURCE_MICROCHIP: "microchip", + /// RESOURCE_CIRCUIT: "circuit" + RESOURCE_CIRCUIT: "circuit", + /// RESOURCE_DEVICE: "device" + RESOURCE_DEVICE: "device", + + /// RESOURCE_CELL: "cell" + RESOURCE_CELL: "cell", + /// RESOURCE_PHLEGM: "phlegm" + RESOURCE_PHLEGM: "phlegm", + /// RESOURCE_TISSUE: "tissue" + RESOURCE_TISSUE: "tissue", + /// RESOURCE_MUSCLE: "muscle" + RESOURCE_MUSCLE: "muscle", + /// RESOURCE_ORGANOID: "organoid" + RESOURCE_ORGANOID: "organoid", + /// RESOURCE_ORGANISM: "organism" + RESOURCE_ORGANISM: "organism", + + /// RESOURCE_ALLOY: "alloy" + RESOURCE_ALLOY: "alloy", + /// RESOURCE_TUBE: "tube" + RESOURCE_TUBE: "tube", + /// RESOURCE_FIXTURES: "fixtures" + RESOURCE_FIXTURES: "fixtures", + /// RESOURCE_FRAME: "frame" + RESOURCE_FRAME: "frame", + /// RESOURCE_HYDRAULICS: "hydraulics" + RESOURCE_HYDRAULICS: "hydraulics", + /// RESOURCE_MACHINE: "machine" + RESOURCE_MACHINE: "machine", + + /// RESOURCE_CONDENSATE: "condensate" + RESOURCE_CONDENSATE: "condensate", + /// RESOURCE_CONCENTRATE: "concentrate" + RESOURCE_CONCENTRATE: "concentrate", + /// RESOURCE_EXTRACT: "extract" + RESOURCE_EXTRACT: "extract", + /// RESOURCE_SPIRIT: "spirit" + RESOURCE_SPIRIT: "spirit", + /// RESOURCE_EMANATION: "emanation" + RESOURCE_EMANATION: "emanation", + /// RESOURCE_ESSENCE: "essence" + RESOURCE_ESSENCE: "essence", +}); + /// The resources and amounts of each resource some game object holds. #[derive(Serialize, Clone, Debug, Default, PartialEq, Eq)] #[serde(transparent)] From b3497cc4bf8ee599e60f38b1d95fede9b8efe19a Mon Sep 17 00:00:00 2001 From: Erik Hofmayer Date: Fri, 15 Jan 2021 15:50:11 +0100 Subject: [PATCH 2/3] Removed RESOURCE_ from resource names --- src/websocket/types/room/resources.rs | 168 +++++++++++++------------- 1 file changed, 84 insertions(+), 84 deletions(-) diff --git a/src/websocket/types/room/resources.rs b/src/websocket/types/room/resources.rs index 89eaa83..ee4e63e 100644 --- a/src/websocket/types/room/resources.rs +++ b/src/websocket/types/room/resources.rs @@ -49,186 +49,186 @@ macro_rules! resource_types { resource_types!({ /// RESOURCE_ENERGY: "energy" - RESOURCE_ENERGY: "energy", + ENERGY: "energy", /// RESOURCE_POWER: "power" - RESOURCE_POWER: "power", + POWER: "power", /// RESOURCE_HYDROGEN: "H" - RESOURCE_HYDROGEN: "H", + HYDROGEN: "H", /// RESOURCE_OXYGEN: "O" - RESOURCE_OXYGEN: "O", + OXYGEN: "O", /// RESOURCE_UTRIUM: "U" - RESOURCE_UTRIUM: "U", + UTRIUM: "U", /// RESOURCE_LEMERGIUM: "L" - RESOURCE_LEMERGIUM: "L", + LEMERGIUM: "L", /// RESOURCE_KEANIUM: "K" - RESOURCE_KEANIUM: "K", + KEANIUM: "K", /// RESOURCE_ZYNTHIUM: "Z" - RESOURCE_ZYNTHIUM: "Z", + ZYNTHIUM: "Z", /// RESOURCE_CATALYST: "X" - RESOURCE_CATALYST: "X", + CATALYST: "X", /// RESOURCE_GHODIUM: "G" - RESOURCE_GHODIUM: "G", + GHODIUM: "G", /// RESOURCE_SILICON: "silicon" - RESOURCE_SILICON: "silicon", + SILICON: "silicon", /// RESOURCE_METAL: "metal" - RESOURCE_METAL: "metal", + METAL: "metal", /// RESOURCE_BIOMASS: "biomass" - RESOURCE_BIOMASS: "biomass", + BIOMASS: "biomass", /// RESOURCE_MIST: "mist" - RESOURCE_MIST: "mist", + MIST: "mist", /// RESOURCE_HYDROXIDE: "OH" - RESOURCE_HYDROXIDE: "OH", + HYDROXIDE: "OH", /// RESOURCE_ZYNTHIUM_KEANITE: "ZK" - RESOURCE_ZYNTHIUM_KEANITE: "ZK", + ZYNTHIUM_KEANITE: "ZK", /// RESOURCE_UTRIUM_LEMERGITE: "UL" - RESOURCE_UTRIUM_LEMERGITE: "UL", + UTRIUM_LEMERGITE: "UL", /// RESOURCE_UTRIUM_HYDRIDE: "UH" - RESOURCE_UTRIUM_HYDRIDE: "UH", + UTRIUM_HYDRIDE: "UH", /// RESOURCE_UTRIUM_OXIDE: "UO" - RESOURCE_UTRIUM_OXIDE: "UO", + UTRIUM_OXIDE: "UO", /// RESOURCE_KEANIUM_HYDRIDE: "KH" - RESOURCE_KEANIUM_HYDRIDE: "KH", + KEANIUM_HYDRIDE: "KH", /// RESOURCE_KEANIUM_OXIDE: "KO" - RESOURCE_KEANIUM_OXIDE: "KO", + KEANIUM_OXIDE: "KO", /// RESOURCE_LEMERGIUM_HYDRIDE: "LH" - RESOURCE_LEMERGIUM_HYDRIDE: "LH", + LEMERGIUM_HYDRIDE: "LH", /// RESOURCE_LEMERGIUM_OXIDE: "LO" - RESOURCE_LEMERGIUM_OXIDE: "LO", + LEMERGIUM_OXIDE: "LO", /// RESOURCE_ZYNTHIUM_HYDRIDE: "ZH" - RESOURCE_ZYNTHIUM_HYDRIDE: "ZH", + ZYNTHIUM_HYDRIDE: "ZH", /// RESOURCE_ZYNTHIUM_OXIDE: "ZO" - RESOURCE_ZYNTHIUM_OXIDE: "ZO", + ZYNTHIUM_OXIDE: "ZO", /// RESOURCE_GHODIUM_HYDRIDE: "GH" - RESOURCE_GHODIUM_HYDRIDE: "GH", + GHODIUM_HYDRIDE: "GH", /// RESOURCE_GHODIUM_OXIDE: "GO" - RESOURCE_GHODIUM_OXIDE: "GO", + GHODIUM_OXIDE: "GO", /// RESOURCE_UTRIUM_ACID: "UH2O" - RESOURCE_UTRIUM_ACID: "UH2O", + UTRIUM_ACID: "UH2O", /// RESOURCE_UTRIUM_ALKALIDE: "UHO2" - RESOURCE_UTRIUM_ALKALIDE: "UHO2", + UTRIUM_ALKALIDE: "UHO2", /// RESOURCE_KEANIUM_ACID: "KH2O" - RESOURCE_KEANIUM_ACID: "KH2O", + KEANIUM_ACID: "KH2O", /// RESOURCE_KEANIUM_ALKALIDE: "KHO2" - RESOURCE_KEANIUM_ALKALIDE: "KHO2", + KEANIUM_ALKALIDE: "KHO2", /// RESOURCE_LEMERGIUM_ACID: "LH2O" - RESOURCE_LEMERGIUM_ACID: "LH2O", + LEMERGIUM_ACID: "LH2O", /// RESOURCE_LEMERGIUM_ALKALIDE: "LHO2" - RESOURCE_LEMERGIUM_ALKALIDE: "LHO2", + LEMERGIUM_ALKALIDE: "LHO2", /// RESOURCE_ZYNTHIUM_ACID: "ZH2O" - RESOURCE_ZYNTHIUM_ACID: "ZH2O", + ZYNTHIUM_ACID: "ZH2O", /// RESOURCE_ZYNTHIUM_ALKALIDE: "ZHO2" - RESOURCE_ZYNTHIUM_ALKALIDE: "ZHO2", + ZYNTHIUM_ALKALIDE: "ZHO2", /// RESOURCE_GHODIUM_ACID: "GH2O" - RESOURCE_GHODIUM_ACID: "GH2O", + GHODIUM_ACID: "GH2O", /// RESOURCE_GHODIUM_ALKALIDE: "GHO2" - RESOURCE_GHODIUM_ALKALIDE: "GHO2", + GHODIUM_ALKALIDE: "GHO2", /// RESOURCE_CATALYZED_UTRIUM_ACID: "XUH2O" - RESOURCE_CATALYZED_UTRIUM_ACID: "XUH2O", + CATALYZED_UTRIUM_ACID: "XUH2O", /// RESOURCE_CATALYZED_UTRIUM_ALKALIDE: "XUHO2" - RESOURCE_CATALYZED_UTRIUM_ALKALIDE: "XUHO2", + CATALYZED_UTRIUM_ALKALIDE: "XUHO2", /// RESOURCE_CATALYZED_KEANIUM_ACID: "XKH2O" - RESOURCE_CATALYZED_KEANIUM_ACID: "XKH2O", + CATALYZED_KEANIUM_ACID: "XKH2O", /// RESOURCE_CATALYZED_KEANIUM_ALKALIDE: "XKHO2" - RESOURCE_CATALYZED_KEANIUM_ALKALIDE: "XKHO2", + CATALYZED_KEANIUM_ALKALIDE: "XKHO2", /// RESOURCE_CATALYZED_LEMERGIUM_ACID: "XLH2O" - RESOURCE_CATALYZED_LEMERGIUM_ACID: "XLH2O", + CATALYZED_LEMERGIUM_ACID: "XLH2O", /// RESOURCE_CATALYZED_LEMERGIUM_ALKALIDE: "XLHO2" - RESOURCE_CATALYZED_LEMERGIUM_ALKALIDE: "XLHO2", + CATALYZED_LEMERGIUM_ALKALIDE: "XLHO2", /// RESOURCE_CATALYZED_ZYNTHIUM_ACID: "XZH2O" - RESOURCE_CATALYZED_ZYNTHIUM_ACID: "XZH2O", + CATALYZED_ZYNTHIUM_ACID: "XZH2O", /// RESOURCE_CATALYZED_ZYNTHIUM_ALKALIDE: "XZHO2" - RESOURCE_CATALYZED_ZYNTHIUM_ALKALIDE: "XZHO2", + CATALYZED_ZYNTHIUM_ALKALIDE: "XZHO2", /// RESOURCE_CATALYZED_GHODIUM_ACID: "XGH2O" - RESOURCE_CATALYZED_GHODIUM_ACID: "XGH2O", + CATALYZED_GHODIUM_ACID: "XGH2O", /// RESOURCE_CATALYZED_GHODIUM_ALKALIDE: "XGHO2" - RESOURCE_CATALYZED_GHODIUM_ALKALIDE: "XGHO2", + CATALYZED_GHODIUM_ALKALIDE: "XGHO2", /// RESOURCE_OPS: "ops" - RESOURCE_OPS: "ops", + OPS: "ops", /// RESOURCE_UTRIUM_BAR: "utrium_bar" - RESOURCE_UTRIUM_BAR: "utrium_bar", + UTRIUM_BAR: "utrium_bar", /// RESOURCE_LEMERGIUM_BAR: "lemergium_bar" - RESOURCE_LEMERGIUM_BAR: "lemergium_bar", + LEMERGIUM_BAR: "lemergium_bar", /// RESOURCE_ZYNTHIUM_BAR: "zynthium_bar" - RESOURCE_ZYNTHIUM_BAR: "zynthium_bar", + ZYNTHIUM_BAR: "zynthium_bar", /// RESOURCE_KEANIUM_BAR: "keanium_bar" - RESOURCE_KEANIUM_BAR: "keanium_bar", + KEANIUM_BAR: "keanium_bar", /// RESOURCE_GHODIUM_MELT: "ghodium_melt" - RESOURCE_GHODIUM_MELT: "ghodium_melt", + GHODIUM_MELT: "ghodium_melt", /// RESOURCE_OXIDANT: "oxidant" - RESOURCE_OXIDANT: "oxidant", + OXIDANT: "oxidant", /// RESOURCE_REDUCTANT: "reductant" - RESOURCE_REDUCTANT: "reductant", + REDUCTANT: "reductant", /// RESOURCE_PURIFIER: "purifier" - RESOURCE_PURIFIER: "purifier", + PURIFIER: "purifier", /// RESOURCE_BATTERY: "battery" - RESOURCE_BATTERY: "battery", + BATTERY: "battery", /// RESOURCE_COMPOSITE: "composite" - RESOURCE_COMPOSITE: "composite", + COMPOSITE: "composite", /// RESOURCE_CRYSTAL: "crystal" - RESOURCE_CRYSTAL: "crystal", + CRYSTAL: "crystal", /// RESOURCE_LIQUID: "liquid" - RESOURCE_LIQUID: "liquid", + LIQUID: "liquid", /// RESOURCE_WIRE: "wire" - RESOURCE_WIRE: "wire", + WIRE: "wire", /// RESOURCE_SWITCH: "switch" - RESOURCE_SWITCH: "switch", + SWITCH: "switch", /// RESOURCE_TRANSISTOR: "transistor" - RESOURCE_TRANSISTOR: "transistor", + TRANSISTOR: "transistor", /// RESOURCE_MICROCHIP: "microchip" - RESOURCE_MICROCHIP: "microchip", + MICROCHIP: "microchip", /// RESOURCE_CIRCUIT: "circuit" - RESOURCE_CIRCUIT: "circuit", + CIRCUIT: "circuit", /// RESOURCE_DEVICE: "device" - RESOURCE_DEVICE: "device", + DEVICE: "device", /// RESOURCE_CELL: "cell" - RESOURCE_CELL: "cell", + CELL: "cell", /// RESOURCE_PHLEGM: "phlegm" - RESOURCE_PHLEGM: "phlegm", + PHLEGM: "phlegm", /// RESOURCE_TISSUE: "tissue" - RESOURCE_TISSUE: "tissue", + TISSUE: "tissue", /// RESOURCE_MUSCLE: "muscle" - RESOURCE_MUSCLE: "muscle", + MUSCLE: "muscle", /// RESOURCE_ORGANOID: "organoid" - RESOURCE_ORGANOID: "organoid", + ORGANOID: "organoid", /// RESOURCE_ORGANISM: "organism" - RESOURCE_ORGANISM: "organism", + ORGANISM: "organism", /// RESOURCE_ALLOY: "alloy" - RESOURCE_ALLOY: "alloy", + ALLOY: "alloy", /// RESOURCE_TUBE: "tube" - RESOURCE_TUBE: "tube", + TUBE: "tube", /// RESOURCE_FIXTURES: "fixtures" - RESOURCE_FIXTURES: "fixtures", + FIXTURES: "fixtures", /// RESOURCE_FRAME: "frame" - RESOURCE_FRAME: "frame", + FRAME: "frame", /// RESOURCE_HYDRAULICS: "hydraulics" - RESOURCE_HYDRAULICS: "hydraulics", + HYDRAULICS: "hydraulics", /// RESOURCE_MACHINE: "machine" - RESOURCE_MACHINE: "machine", + MACHINE: "machine", /// RESOURCE_CONDENSATE: "condensate" - RESOURCE_CONDENSATE: "condensate", + CONDENSATE: "condensate", /// RESOURCE_CONCENTRATE: "concentrate" - RESOURCE_CONCENTRATE: "concentrate", + CONCENTRATE: "concentrate", /// RESOURCE_EXTRACT: "extract" - RESOURCE_EXTRACT: "extract", + EXTRACT: "extract", /// RESOURCE_SPIRIT: "spirit" - RESOURCE_SPIRIT: "spirit", + SPIRIT: "spirit", /// RESOURCE_EMANATION: "emanation" - RESOURCE_EMANATION: "emanation", + EMANATION: "emanation", /// RESOURCE_ESSENCE: "essence" - RESOURCE_ESSENCE: "essence", + ESSENCE: "essence", }); /// The resources and amounts of each resource some game object holds. From 272944715cbb35d17c0f2a27a9b3dfff676c26eb Mon Sep 17 00:00:00 2001 From: Erik Hofmayer Date: Fri, 15 Jan 2021 16:05:32 +0100 Subject: [PATCH 3/3] Finished renaming resources --- src/websocket/types/room/resources.rs | 168 +++++++++++++------------- 1 file changed, 84 insertions(+), 84 deletions(-) diff --git a/src/websocket/types/room/resources.rs b/src/websocket/types/room/resources.rs index ee4e63e..610c870 100644 --- a/src/websocket/types/room/resources.rs +++ b/src/websocket/types/room/resources.rs @@ -49,186 +49,186 @@ macro_rules! resource_types { resource_types!({ /// RESOURCE_ENERGY: "energy" - ENERGY: "energy", + Energy: "energy", /// RESOURCE_POWER: "power" - POWER: "power", + Power: "power", /// RESOURCE_HYDROGEN: "H" - HYDROGEN: "H", + Hydrogen: "H", /// RESOURCE_OXYGEN: "O" - OXYGEN: "O", + Oxygen: "O", /// RESOURCE_UTRIUM: "U" - UTRIUM: "U", + Utrium: "U", /// RESOURCE_LEMERGIUM: "L" - LEMERGIUM: "L", + Lemergium: "L", /// RESOURCE_KEANIUM: "K" - KEANIUM: "K", + Keanium: "K", /// RESOURCE_ZYNTHIUM: "Z" - ZYNTHIUM: "Z", + Zynthium: "Z", /// RESOURCE_CATALYST: "X" - CATALYST: "X", + Catalyst: "X", /// RESOURCE_GHODIUM: "G" - GHODIUM: "G", + Ghodium: "G", /// RESOURCE_SILICON: "silicon" - SILICON: "silicon", + Silicon: "silicon", /// RESOURCE_METAL: "metal" - METAL: "metal", + Metal: "metal", /// RESOURCE_BIOMASS: "biomass" - BIOMASS: "biomass", + Biomass: "biomass", /// RESOURCE_MIST: "mist" - MIST: "mist", + Mist: "mist", /// RESOURCE_HYDROXIDE: "OH" - HYDROXIDE: "OH", + Hydroxide: "OH", /// RESOURCE_ZYNTHIUM_KEANITE: "ZK" - ZYNTHIUM_KEANITE: "ZK", + ZynthiumKeanite: "ZK", /// RESOURCE_UTRIUM_LEMERGITE: "UL" - UTRIUM_LEMERGITE: "UL", + UtriumLemergite: "UL", /// RESOURCE_UTRIUM_HYDRIDE: "UH" - UTRIUM_HYDRIDE: "UH", + UtriumHydride: "UH", /// RESOURCE_UTRIUM_OXIDE: "UO" - UTRIUM_OXIDE: "UO", + UtriumOxide: "UO", /// RESOURCE_KEANIUM_HYDRIDE: "KH" - KEANIUM_HYDRIDE: "KH", + KeaniumHydride: "KH", /// RESOURCE_KEANIUM_OXIDE: "KO" - KEANIUM_OXIDE: "KO", + KeaniumOxide: "KO", /// RESOURCE_LEMERGIUM_HYDRIDE: "LH" - LEMERGIUM_HYDRIDE: "LH", + LemergiumHydride: "LH", /// RESOURCE_LEMERGIUM_OXIDE: "LO" - LEMERGIUM_OXIDE: "LO", + LemergiumOxide: "LO", /// RESOURCE_ZYNTHIUM_HYDRIDE: "ZH" - ZYNTHIUM_HYDRIDE: "ZH", + ZynthiumHydride: "ZH", /// RESOURCE_ZYNTHIUM_OXIDE: "ZO" - ZYNTHIUM_OXIDE: "ZO", + ZynthiumOxide: "ZO", /// RESOURCE_GHODIUM_HYDRIDE: "GH" - GHODIUM_HYDRIDE: "GH", + GhodiumHydride: "GH", /// RESOURCE_GHODIUM_OXIDE: "GO" - GHODIUM_OXIDE: "GO", + GhodiumOxide: "GO", /// RESOURCE_UTRIUM_ACID: "UH2O" - UTRIUM_ACID: "UH2O", + UtriumAcid: "UH2O", /// RESOURCE_UTRIUM_ALKALIDE: "UHO2" - UTRIUM_ALKALIDE: "UHO2", + UtriumAlkalide: "UHO2", /// RESOURCE_KEANIUM_ACID: "KH2O" - KEANIUM_ACID: "KH2O", + KeaniumAcid: "KH2O", /// RESOURCE_KEANIUM_ALKALIDE: "KHO2" - KEANIUM_ALKALIDE: "KHO2", + KeaniumAlkalide: "KHO2", /// RESOURCE_LEMERGIUM_ACID: "LH2O" - LEMERGIUM_ACID: "LH2O", + LemergiumAcid: "LH2O", /// RESOURCE_LEMERGIUM_ALKALIDE: "LHO2" - LEMERGIUM_ALKALIDE: "LHO2", + LemergiumAlkalide: "LHO2", /// RESOURCE_ZYNTHIUM_ACID: "ZH2O" - ZYNTHIUM_ACID: "ZH2O", + ZynthiumAcid: "ZH2O", /// RESOURCE_ZYNTHIUM_ALKALIDE: "ZHO2" - ZYNTHIUM_ALKALIDE: "ZHO2", + ZynthiumAlkalide: "ZHO2", /// RESOURCE_GHODIUM_ACID: "GH2O" - GHODIUM_ACID: "GH2O", + GhodiumAcid: "GH2O", /// RESOURCE_GHODIUM_ALKALIDE: "GHO2" - GHODIUM_ALKALIDE: "GHO2", + GhodiumAlkalide: "GHO2", /// RESOURCE_CATALYZED_UTRIUM_ACID: "XUH2O" - CATALYZED_UTRIUM_ACID: "XUH2O", + CatalyzedUtriumAcid: "XUH2O", /// RESOURCE_CATALYZED_UTRIUM_ALKALIDE: "XUHO2" - CATALYZED_UTRIUM_ALKALIDE: "XUHO2", + CatalyzedUtriumAlkalide: "XUHO2", /// RESOURCE_CATALYZED_KEANIUM_ACID: "XKH2O" - CATALYZED_KEANIUM_ACID: "XKH2O", + CatalyzedKeaniumAcid: "XKH2O", /// RESOURCE_CATALYZED_KEANIUM_ALKALIDE: "XKHO2" - CATALYZED_KEANIUM_ALKALIDE: "XKHO2", + CatalyzedKeaniumAlkalide: "XKHO2", /// RESOURCE_CATALYZED_LEMERGIUM_ACID: "XLH2O" - CATALYZED_LEMERGIUM_ACID: "XLH2O", + CatalyzedLemergiumAcid: "XLH2O", /// RESOURCE_CATALYZED_LEMERGIUM_ALKALIDE: "XLHO2" - CATALYZED_LEMERGIUM_ALKALIDE: "XLHO2", + CatalyzedLemergiumAlkalide: "XLHO2", /// RESOURCE_CATALYZED_ZYNTHIUM_ACID: "XZH2O" - CATALYZED_ZYNTHIUM_ACID: "XZH2O", + CatalyzedZynthiumAcid: "XZH2O", /// RESOURCE_CATALYZED_ZYNTHIUM_ALKALIDE: "XZHO2" - CATALYZED_ZYNTHIUM_ALKALIDE: "XZHO2", + CatalyzedZynthiumAlkalide: "XZHO2", /// RESOURCE_CATALYZED_GHODIUM_ACID: "XGH2O" - CATALYZED_GHODIUM_ACID: "XGH2O", + CatalyzedGhodiumAcid: "XGH2O", /// RESOURCE_CATALYZED_GHODIUM_ALKALIDE: "XGHO2" - CATALYZED_GHODIUM_ALKALIDE: "XGHO2", + CatalyzedGhodiumAlkalide: "XGHO2", /// RESOURCE_OPS: "ops" - OPS: "ops", + Ops: "ops", /// RESOURCE_UTRIUM_BAR: "utrium_bar" - UTRIUM_BAR: "utrium_bar", + UtriumBar: "utrium_bar", /// RESOURCE_LEMERGIUM_BAR: "lemergium_bar" - LEMERGIUM_BAR: "lemergium_bar", + LemergiumBar: "lemergium_bar", /// RESOURCE_ZYNTHIUM_BAR: "zynthium_bar" - ZYNTHIUM_BAR: "zynthium_bar", + ZynthiumBar: "zynthium_bar", /// RESOURCE_KEANIUM_BAR: "keanium_bar" - KEANIUM_BAR: "keanium_bar", + KeaniumBar: "keanium_bar", /// RESOURCE_GHODIUM_MELT: "ghodium_melt" - GHODIUM_MELT: "ghodium_melt", + GhodiumMelt: "ghodium_melt", /// RESOURCE_OXIDANT: "oxidant" - OXIDANT: "oxidant", + Oxidant: "oxidant", /// RESOURCE_REDUCTANT: "reductant" - REDUCTANT: "reductant", + Reductant: "reductant", /// RESOURCE_PURIFIER: "purifier" - PURIFIER: "purifier", + Purifier: "purifier", /// RESOURCE_BATTERY: "battery" - BATTERY: "battery", + Battery: "battery", /// RESOURCE_COMPOSITE: "composite" - COMPOSITE: "composite", + Composite: "composite", /// RESOURCE_CRYSTAL: "crystal" - CRYSTAL: "crystal", + Crystal: "crystal", /// RESOURCE_LIQUID: "liquid" - LIQUID: "liquid", + Liquid: "liquid", /// RESOURCE_WIRE: "wire" - WIRE: "wire", + Wire: "wire", /// RESOURCE_SWITCH: "switch" - SWITCH: "switch", + Switch: "switch", /// RESOURCE_TRANSISTOR: "transistor" - TRANSISTOR: "transistor", + Transistor: "transistor", /// RESOURCE_MICROCHIP: "microchip" - MICROCHIP: "microchip", + Microchip: "microchip", /// RESOURCE_CIRCUIT: "circuit" - CIRCUIT: "circuit", + Circuit: "circuit", /// RESOURCE_DEVICE: "device" - DEVICE: "device", + Device: "device", /// RESOURCE_CELL: "cell" - CELL: "cell", + Cell: "cell", /// RESOURCE_PHLEGM: "phlegm" - PHLEGM: "phlegm", + Phlegm: "phlegm", /// RESOURCE_TISSUE: "tissue" - TISSUE: "tissue", + Tissue: "tissue", /// RESOURCE_MUSCLE: "muscle" - MUSCLE: "muscle", + Muscle: "muscle", /// RESOURCE_ORGANOID: "organoid" - ORGANOID: "organoid", + Organoid: "organoid", /// RESOURCE_ORGANISM: "organism" - ORGANISM: "organism", + Organism: "organism", /// RESOURCE_ALLOY: "alloy" - ALLOY: "alloy", + Alloy: "alloy", /// RESOURCE_TUBE: "tube" - TUBE: "tube", + Tube: "tube", /// RESOURCE_FIXTURES: "fixtures" - FIXTURES: "fixtures", + Fixtures: "fixtures", /// RESOURCE_FRAME: "frame" - FRAME: "frame", + Frame: "frame", /// RESOURCE_HYDRAULICS: "hydraulics" - HYDRAULICS: "hydraulics", + Hydraulics: "hydraulics", /// RESOURCE_MACHINE: "machine" - MACHINE: "machine", + Machine: "machine", /// RESOURCE_CONDENSATE: "condensate" - CONDENSATE: "condensate", + Condensate: "condensate", /// RESOURCE_CONCENTRATE: "concentrate" - CONCENTRATE: "concentrate", + Concentrate: "concentrate", /// RESOURCE_EXTRACT: "extract" - EXTRACT: "extract", + Extract: "extract", /// RESOURCE_SPIRIT: "spirit" - SPIRIT: "spirit", + Spirit: "spirit", /// RESOURCE_EMANATION: "emanation" - EMANATION: "emanation", + Emanation: "emanation", /// RESOURCE_ESSENCE: "essence" - ESSENCE: "essence", + Essence: "essence", }); /// The resources and amounts of each resource some game object holds.