Skip to content

Commit

Permalink
Add StructureFactory::level() which I missed when adding factories (#310
Browse files Browse the repository at this point in the history
)
  • Loading branch information
shanemadden authored May 5, 2020
1 parent 9365fbb commit b61ddfe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ Unreleased
lifetime points required for a given level of GCL or GPL
- Change `constants::GCL_POW` to f64 from f32 due to slightly incorrect calculations when using
this from f32 to calculate GCL levels (breaking)
- Add missed `StructureFactory::level` function to determine a factory's level (or `None` if a
power creep has not yet used `OPERATE_FACTORY`)

0.7.0 (2019-10-19)
==================
Expand Down
6 changes: 6 additions & 0 deletions src/objects/impls/structure_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ use crate::{
objects::StructureFactory,
};

simple_accessors! {
impl StructureFactory {
pub fn level() -> Option<u32> = level;
}
}

impl StructureFactory {
pub fn produce(&self, ty: ResourceType) -> ReturnCode {
js_unwrap! {@{self.as_ref()}.produce(__resource_type_num_to_str(@{ty as u32}))}
Expand Down

0 comments on commit b61ddfe

Please sign in to comment.