misc names

This commit is contained in:
Mashy 2019-10-08 13:47:02 +10:00
parent 6978a424d9
commit d3daa3c1f2

View File

@ -161,12 +161,12 @@ impl Game {
self.skill_phase_start(0) self.skill_phase_start(0)
} }
fn skill_phase_start(mut self, resolution_time: i64) -> Game { fn skill_phase_start(mut self, resolution_animation_ms: i64) -> Game {
self.phase_start = Utc::now() self.phase_start = Utc::now()
.checked_add_signed(Duration::milliseconds(resolution_time)) .checked_add_signed(Duration::milliseconds(resolution_animation_ms))
.expect("could not set phase start"); .expect("could not set phase start");
self.phase_end = self.time_control.game_phase_end(resolution_time); self.phase_end = self.time_control.game_phase_end(resolution_animation_ms);
for player in self.players.iter_mut() { for player in self.players.iter_mut() {
if player.skills_required() == 0 { if player.skills_required() == 0 {
@ -426,12 +426,12 @@ impl Game {
// temp vec of this round's resolving skills // temp vec of this round's resolving skills
// because need to check cooldown use before pushing them into the complete list // because need to check cooldown use before pushing them into the complete list
let mut casts = vec![]; let mut casts = vec![];
let mut resolution_delay = 0; let mut r_animation_ms = 0;
while let Some(cast) = self.stack.pop() { while let Some(cast) = self.stack.pop() {
// info!("{:} casts ", cast); // info!("{:} casts ", cast);
let mut resolutions = resolution_steps(&cast, &mut self); let mut resolutions = resolution_steps(&cast, &mut self);
resolution_delay = resolutions.iter().fold(resolution_delay, |acc, r| acc + r.clone().get_delay()); r_animation_ms = resolutions.iter().fold(r_animation_ms, |acc, r| acc + r.clone().get_delay());
self.resolved.append(&mut resolutions); self.resolved.append(&mut resolutions);
// while let Some(resolution) = resolutions.pop() { // while let Some(resolution) = resolutions.pop() {
@ -457,7 +457,7 @@ impl Game {
return self.finish() return self.finish()
} }
self.skill_phase_start(resolution_delay) self.skill_phase_start(r_animation_ms)
} }
fn progress_durations(&mut self, resolved: &Vec<Cast>) -> &mut Game { fn progress_durations(&mut self, resolved: &Vec<Cast>) -> &mut Game {