aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/production.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/fparkan-runtime/src/production.rs')
-rw-r--r--crates/fparkan-runtime/src/production.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/fparkan-runtime/src/production.rs b/crates/fparkan-runtime/src/production.rs
index a6752712..05914d73 100644
--- a/crates/fparkan-runtime/src/production.rs
+++ b/crates/fparkan-runtime/src/production.rs
@@ -134,6 +134,17 @@ impl PaidOrder {
}
impl Production {
+ pub(super) fn reserved_minds(&self, world: &World, owner: OwnerId) -> usize {
+ self.pending
+ .iter()
+ .filter(|order| {
+ order.owner == owner
+ && identity_metadata(world, order.plant)
+ .is_ok_and(|identity| identity.owner_id == Some(owner))
+ })
+ .count()
+ }
+
pub(super) fn is_building_at(&self, plant: ObjectHandle, owner: OwnerId) -> bool {
self.pending
.iter()