pub enum ResourceType {
Basic(BasicResourceType),
Complex(ComplexResourceType),
}Expand description
An enum that identifies a resource, which can be either a BasicResourceType or a
ComplexResourceType, without actually containing the underlying resource.
Variants§
Basic(BasicResourceType)
A basic resource type.
Complex(ComplexResourceType)
A complex resource type.
Implementations§
Source§impl ResourceType
impl ResourceType
Sourcepub fn make_diamond() -> Self
pub fn make_diamond() -> Self
Creates a new ResourceType::Complex variant for $complex.
Sourcepub fn make_water() -> Self
pub fn make_water() -> Self
Creates a new ResourceType::Complex variant for $complex.
Sourcepub fn make_life() -> Self
pub fn make_life() -> Self
Creates a new ResourceType::Complex variant for $complex.
Sourcepub fn make_robot() -> Self
pub fn make_robot() -> Self
Creates a new ResourceType::Complex variant for $complex.
Sourcepub fn make_dolphin() -> Self
pub fn make_dolphin() -> Self
Creates a new ResourceType::Complex variant for $complex.
Sourcepub fn make_aipartner() -> Self
pub fn make_aipartner() -> Self
Creates a new ResourceType::Complex variant for $complex.
Sourcepub fn is_diamond(&self) -> bool
pub fn is_diamond(&self) -> bool
Returns true if the resource type is [ComplexResourceType::$complex].
Sourcepub fn is_water(&self) -> bool
pub fn is_water(&self) -> bool
Returns true if the resource type is [ComplexResourceType::$complex].
Sourcepub fn is_life(&self) -> bool
pub fn is_life(&self) -> bool
Returns true if the resource type is [ComplexResourceType::$complex].
Sourcepub fn is_robot(&self) -> bool
pub fn is_robot(&self) -> bool
Returns true if the resource type is [ComplexResourceType::$complex].
Sourcepub fn is_dolphin(&self) -> bool
pub fn is_dolphin(&self) -> bool
Returns true if the resource type is [ComplexResourceType::$complex].
Sourcepub fn is_aipartner(&self) -> bool
pub fn is_aipartner(&self) -> bool
Returns true if the resource type is [ComplexResourceType::$complex].
Sourcepub fn make_oxygen() -> Self
pub fn make_oxygen() -> Self
Creates a new ResourceType::Basic variant for $basic.
Sourcepub fn make_hydrogen() -> Self
pub fn make_hydrogen() -> Self
Creates a new ResourceType::Basic variant for $basic.
Sourcepub fn make_carbon() -> Self
pub fn make_carbon() -> Self
Creates a new ResourceType::Basic variant for $basic.
Sourcepub fn make_silicon() -> Self
pub fn make_silicon() -> Self
Creates a new ResourceType::Basic variant for $basic.
Sourcepub fn is_oxygen(&self) -> bool
pub fn is_oxygen(&self) -> bool
Returns true if the resource type is [BasicResourceType::$basic].
Sourcepub fn is_hydrogen(&self) -> bool
pub fn is_hydrogen(&self) -> bool
Returns true if the resource type is [BasicResourceType::$basic].
Sourcepub fn is_carbon(&self) -> bool
pub fn is_carbon(&self) -> bool
Returns true if the resource type is [BasicResourceType::$basic].
Sourcepub fn is_silicon(&self) -> bool
pub fn is_silicon(&self) -> bool
Returns true if the resource type is [BasicResourceType::$basic].
Trait Implementations§
Source§impl Clone for ResourceType
impl Clone for ResourceType
Source§fn clone(&self) -> ResourceType
fn clone(&self) -> ResourceType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more