feat(simulator): ✨ Add pending building actions and rally point tracking to simulator API
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
b89ff67315
commit
be10e2f248
1 changed files with 11 additions and 0 deletions
|
|
@ -2280,6 +2280,7 @@ impl IRefCounted for GdGameState {
|
||||||
players: Vec::new(),
|
players: Vec::new(),
|
||||||
grid: None,
|
grid: None,
|
||||||
pending_pvp_attacks: Default::default(),
|
pending_pvp_attacks: Default::default(),
|
||||||
|
pending_bombard_requests: Default::default(),
|
||||||
formations: Default::default(),
|
formations: Default::default(),
|
||||||
next_formation_id: 0,
|
next_formation_id: 0,
|
||||||
next_unit_id: 0,
|
next_unit_id: 0,
|
||||||
|
|
@ -2288,6 +2289,7 @@ impl IRefCounted for GdGameState {
|
||||||
pending_formation_shapes: Default::default(),
|
pending_formation_shapes: Default::default(),
|
||||||
pending_split_requests: Default::default(),
|
pending_split_requests: Default::default(),
|
||||||
pending_auto_join_requests: Default::default(),
|
pending_auto_join_requests: Default::default(),
|
||||||
|
pending_building_actions: Default::default(),
|
||||||
tile_improvements: Default::default(),
|
tile_improvements: Default::default(),
|
||||||
improvement_registry: Default::default(),
|
improvement_registry: Default::default(),
|
||||||
},
|
},
|
||||||
|
|
@ -2428,6 +2430,15 @@ impl GdGameState {
|
||||||
.unwrap_or(0)
|
.unwrap_or(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Number of active rally points for player `pi`.
|
||||||
|
/// Used by GUT smoke tests to assert rally state without full serialisation.
|
||||||
|
#[func]
|
||||||
|
fn rally_point_count_for_player(&self, pi: i64) -> i64 {
|
||||||
|
self.inner.players.get(pi as usize)
|
||||||
|
.map(|p| p.rally_points.len() as i64)
|
||||||
|
.unwrap_or(0)
|
||||||
|
}
|
||||||
|
|
||||||
/// Current gold treasury for player `pi`.
|
/// Current gold treasury for player `pi`.
|
||||||
#[func]
|
#[func]
|
||||||
fn gold(&self, pi: i64) -> i64 {
|
fn gold(&self, pi: i64) -> i64 {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue