Skip to content

Commit

Permalink
add seasonal store types
Browse files Browse the repository at this point in the history
  • Loading branch information
asquared31415 committed Feb 29, 2024
1 parent b41041a commit f5a6ae1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Unreleased
- Add function `StoreObject::resource_types` to get the types of resources that a store can hold
- This can be used with a `StructureObject` as `StoreObject::try_from(structure_object).map(|store| store.resource_types())`
which returns a `Result<&'static [ResourceType], StoreObjectConversionError>`
- Add missing `StoreObject::Reactor` to the `seasonal-season-5` feature.

0.20.1 (2024-01-09)
===================
Expand Down
10 changes: 10 additions & 0 deletions src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ pub enum ObjectWithPosition {
pub enum StoreObject {
Creep,
PowerCreep,
#[cfg(feature = "seasonal-season-5")]
Reactor,
Ruin,
#[cfg(feature = "seasonal-season-1")]
ScoreCollector,
Expand Down Expand Up @@ -214,7 +216,13 @@ impl StoreObject {
match self {
StoreObject::Creep(_) => RESOURCES_ALL,
StoreObject::PowerCreep(_) => RESOURCES_ALL,
#[cfg(feature = "seasonal-season-5")]
StoreObject::Reactor(_) => &[ResourceType::Thorium],
StoreObject::Ruin(_) => RESOURCES_ALL,
#[cfg(feature = "seasonal-season-1")]
StoreObject::ScoreCollector(_) => &[ResourceType::Score],
#[cfg(feature = "seasonal-season-1")]
StoreObject::ScoreContainer(_) => &[ResourceType::Score],
StoreObject::StructureContainer(_) => RESOURCES_ALL,
StoreObject::StructureExtension(_) => &[ResourceType::Energy],
StoreObject::StructureFactory(_) => RESOURCES_ALL,
Expand All @@ -226,6 +234,8 @@ impl StoreObject {
StoreObject::StructureStorage(_) => RESOURCES_ALL,
StoreObject::StructureTerminal(_) => RESOURCES_ALL,
StoreObject::StructureTower(_) => &[ResourceType::Energy],
#[cfg(feature = "seasonal-season-2")]
StoreObject::SymbolContainer(_) => &crate::constants::seasonal::season_2::SYMBOLS,
StoreObject::Tombstone(_) => RESOURCES_ALL,
}
}
Expand Down

0 comments on commit f5a6ae1

Please sign in to comment.