diff --git a/client/src/action_buttons.rs b/client/src/action_buttons.rs index 04e5e3fa..befd9be7 100644 --- a/client/src/action_buttons.rs +++ b/client/src/action_buttons.rs @@ -27,17 +27,7 @@ pub fn action_buttons(rc: &RenderContext) -> StateUpdate { if rc.can_play_action(PlayingActionType::MoveUnits) && bottom_left_texture(rc, &assets.move_units, icon_pos(0, -3), "Move units") { - return StateUpdate::MoveUnits( - if rc - .state - .focused_tile - .is_some_and(|t| rc.game.map.is_water(t)) - { - MoveIntent::Sea - } else { - MoveIntent::Land - }, - ); + return global_move(rc); } if rc.can_play_action(PlayingActionType::Advance) @@ -74,6 +64,19 @@ pub fn action_buttons(rc: &RenderContext) -> StateUpdate { StateUpdate::None } +fn global_move(rc: &RenderContext) -> StateUpdate { + let pos = rc.state.focused_tile; + StateUpdate::move_units( + rc, + pos, + if pos.is_some_and(|t| rc.game.map.is_water(t)) { + MoveIntent::Sea + } else { + MoveIntent::Land + }, + ) +} + fn custom_action_tooltip(custom_action_type: &CustomActionType) -> String { match custom_action_type { CustomActionType::ConstructWonder => "Construct a wonder".to_string(), diff --git a/client/src/advance_ui.rs b/client/src/advance_ui.rs index e0c72466..8a4d2e74 100644 --- a/client/src/advance_ui.rs +++ b/client/src/advance_ui.rs @@ -5,6 +5,7 @@ use crate::log_ui::break_text; use crate::payment_ui::{payment_dialog, HasPayment, Payment, ResourcePayment}; use crate::player_ui::player_color; use crate::render_context::RenderContext; +use crate::resource_ui::new_resource_map; use crate::select_ui::HasCountSelectableObject; use crate::tooltip::show_tooltip_for_rect; use macroquad::color::Color; @@ -20,7 +21,7 @@ use server::game::GameState; use server::payment::PaymentModel; use server::player::Player; use server::playing_actions::PlayingAction; -use server::resource::{new_resource_map, ResourceType}; +use server::resource::ResourceType; use server::status_phase::StatusPhaseAction; use std::cmp::min; use std::ops::Rem; diff --git a/client/src/client.rs b/client/src/client.rs index 307d2a41..0a8a770a 100644 --- a/client/src/client.rs +++ b/client/src/client.rs @@ -126,7 +126,6 @@ fn render_active_dialog(rc: &RenderContext) -> StateUpdate { let state = rc.state; match &state.active_dialog { ActiveDialog::None - | ActiveDialog::MoveUnits(_) | ActiveDialog::WaitingForUpdate | ActiveDialog::CulturalInfluence | ActiveDialog::PlaceSettler => StateUpdate::None, @@ -145,6 +144,7 @@ fn render_active_dialog(rc: &RenderContext) -> StateUpdate { influence_ui::cultural_influence_resolution_dialog(rc, r) } ActiveDialog::ExploreResolution(r) => explore_dialog(rc, r), + ActiveDialog::MoveUnits(_) => move_ui::move_units_dialog(rc), //status phase ActiveDialog::FreeAdvance => show_free_advance_menu(rc), diff --git a/client/src/client_state.rs b/client/src/client_state.rs index ddd8342f..50736637 100644 --- a/client/src/client_state.rs +++ b/client/src/client_state.rs @@ -3,8 +3,7 @@ use server::action::Action; use server::city::{City, MoodState}; use server::combat::{active_attackers, active_defenders, CombatPhase}; use server::content::advances::{NAVIGATION, ROADS}; -use server::game::{CulturalInfluenceResolution, Game, GameState}; -use server::playing_actions::PlayingAction; +use server::game::{CulturalInfluenceResolution, CurrentMove, Game, GameState}; use server::position::Position; use server::status_phase::{StatusPhaseAction, StatusPhaseState}; @@ -223,7 +222,6 @@ pub struct DialogChooser { pub enum StateUpdate { None, OpenDialog(ActiveDialog), - MoveUnits(MoveIntent), CloseDialog, Cancel, ResolvePendingUpdate(bool), @@ -306,6 +304,21 @@ impl StateUpdate { StateUpdate::Execute(Action::StatusPhase(action)) } + pub fn move_units( + rc: &RenderContext, + pos: Option, + intent: MoveIntent, + ) -> StateUpdate { + let game = rc.game; + StateUpdate::OpenDialog(ActiveDialog::MoveUnits(MoveSelection::new( + game.active_player(), + pos, + game, + intent, + &CurrentMove::None, + ))) + } + pub fn or(self, other: impl FnOnce() -> StateUpdate) -> StateUpdate { match self { StateUpdate::None => other(), @@ -364,7 +377,6 @@ pub struct State { pub mouse_positions: Vec, pub log_scroll: f32, pub focused_tile: Option, - pub move_intent: MoveIntent, pub pan_map: bool, } @@ -390,7 +402,6 @@ impl State { mouse_positions: vec![], log_scroll: 0.0, focused_tile: None, - move_intent: MoveIntent::Land, // is set before use pan_map: false, } } @@ -415,10 +426,6 @@ impl State { match update { StateUpdate::None => GameSyncRequest::None, StateUpdate::Execute(a) => GameSyncRequest::ExecuteAction(a), - StateUpdate::MoveUnits(intent) => { - self.move_intent = intent; - GameSyncRequest::ExecuteAction(Action::Playing(PlayingAction::MoveUnits)) - } StateUpdate::ExecuteWithWarning(update) => { self.pending_update = Some(update); GameSyncRequest::None @@ -490,8 +497,8 @@ impl State { game.active_player(), self.focused_tile, game, - &self.move_intent, - move_state, + MoveIntent::Land, // is not used, because no tile is focused + &move_state.current_move, )), GameState::CulturalInfluenceResolution(c) => { ActiveDialog::CulturalInfluenceResolution(c.clone()) diff --git a/client/src/collect_ui.rs b/client/src/collect_ui.rs index 5f8e57f4..318f9566 100644 --- a/client/src/collect_ui.rs +++ b/client/src/collect_ui.rs @@ -11,7 +11,7 @@ use crate::layout_ui::{ draw_icon, draw_scaled_icon, is_in_circle, left_mouse_button_pressed, ICON_SIZE, }; use crate::render_context::RenderContext; -use crate::resource_ui::{resource_name, show_resource_pile}; +use crate::resource_ui::{new_resource_map, resource_name, show_resource_pile}; use macroquad::color::BLACK; use macroquad::math::vec2; use macroquad::prelude::WHITE; @@ -22,7 +22,7 @@ use server::content::custom_actions::CustomAction; use server::game::Game; use server::playing_actions::{get_total_collection, Collect, PlayingAction}; use server::position::Position; -use server::resource::{new_resource_map, resource_types, ResourceType}; +use server::resource::{resource_types, ResourceType}; use server::resource_pile::ResourcePile; #[derive(Clone)] diff --git a/client/src/construct_ui.rs b/client/src/construct_ui.rs index 79b8f16b..5fdc0907 100644 --- a/client/src/construct_ui.rs +++ b/client/src/construct_ui.rs @@ -7,6 +7,7 @@ use crate::dialog_ui::OkTooltip; use crate::payment_ui::{payment_dialog, HasPayment, Payment, ResourcePayment}; use crate::recruit_unit_ui::RecruitSelection; use crate::render_context::RenderContext; +use crate::resource_ui::new_resource_map; use crate::select_ui::CountSelector; use server::action::Action; use server::city::City; @@ -15,7 +16,7 @@ use server::content::custom_actions::CustomAction; use server::map::Terrain; use server::playing_actions::{Construct, PlayingAction, Recruit}; use server::position::Position; -use server::resource::{new_resource_map, ResourceType}; +use server::resource::ResourceType; use server::resource_pile::PaymentOptions; use server::unit::UnitType; diff --git a/client/src/local_client/bin/main.rs b/client/src/local_client/bin/main.rs index 604d55f0..b71517a3 100644 --- a/client/src/local_client/bin/main.rs +++ b/client/src/local_client/bin/main.rs @@ -86,8 +86,8 @@ pub fn setup_local_game() -> Game { let player_index1 = 0; let player_index2 = 1; - game.players[player_index1].gain_resources(ResourcePile::new(50, 50, 50, 50, 50, 9, 9)); - game.players[player_index2].gain_resources(ResourcePile::new(50, 50, 50, 50, 50, 9, 9)); + game.players[player_index1].gain_resources(ResourcePile::new(0, 5, 5, 5, 5, 9, 9)); + game.players[player_index2].gain_resources(ResourcePile::new(0, 5, 5, 5, 5, 9, 9)); add_city(&mut game, player_index1, "A1"); add_city(&mut game, player_index1, "C2"); add_city(&mut game, player_index1, "B1"); diff --git a/client/src/map_ui.rs b/client/src/map_ui.rs index 1d92a12f..b527c551 100644 --- a/client/src/map_ui.rs +++ b/client/src/map_ui.rs @@ -246,7 +246,7 @@ pub fn move_units_button<'a>( Some(( move_intent.icon(rc), move_intent.toolip().to_string(), - Box::new(move || StateUpdate::MoveUnits(move_intent.clone())), + Box::new(move || StateUpdate::move_units(rc, Some(pos), move_intent)), )) } diff --git a/client/src/move_ui.rs b/client/src/move_ui.rs index d0878388..4495be25 100644 --- a/client/src/move_ui.rs +++ b/client/src/move_ui.rs @@ -1,16 +1,17 @@ use macroquad::math::{u32, Vec2}; use macroquad::prelude::Texture2D; use server::action::Action; -use server::game::{CurrentMove, Game, MoveState}; +use server::game::{CurrentMove, Game, GameState}; use server::player::Player; use server::position::Position; use server::unit::{MovementAction, Unit, UnitType}; use crate::client_state::{ActiveDialog, StateUpdate}; +use crate::dialog_ui::cancel_button_with_tooltip; use crate::render_context::RenderContext; use crate::unit_ui::{click_unit, unit_selection_clicked}; -#[derive(Clone)] +#[derive(Clone, Copy)] pub enum MoveIntent { Land, Sea, @@ -18,7 +19,7 @@ pub enum MoveIntent { } impl MoveIntent { - pub fn to_predicate(&self) -> impl Fn(&Unit) -> bool { + pub fn to_predicate(self) -> impl Fn(&Unit) -> bool { match self { MoveIntent::Land => |u: &Unit| u.unit_type.is_land_based() && !u.is_transported(), MoveIntent::Sea => |u: &Unit| !u.unit_type.is_land_based(), @@ -34,7 +35,7 @@ impl MoveIntent { } } - pub fn icon<'a>(&self, rc: &'a RenderContext) -> &'a Texture2D { + pub fn icon<'a>(self, rc: &'a RenderContext) -> &'a Texture2D { match self { MoveIntent::Land => &rc.assets().move_units, MoveIntent::Sea => &rc.assets().units[&UnitType::Ship], @@ -177,7 +178,6 @@ pub struct MoveSelection { pub units: Vec, pub start: Option, pub destinations: Vec, - // pub lo } impl MoveSelection { @@ -185,10 +185,10 @@ impl MoveSelection { player_index: usize, start: Option, game: &Game, - move_intent: &MoveIntent, - move_state: &MoveState, + move_intent: MoveIntent, + current_move: &CurrentMove, ) -> MoveSelection { - if let CurrentMove::Fleet { units } = &move_state.current_move { + if let CurrentMove::Fleet { units } = current_move { let fleet_pos = game .get_player(player_index) .get_unit(units[0]) @@ -233,3 +233,12 @@ impl MoveSelection { } } } + +pub(crate) fn move_units_dialog(rc: &RenderContext) -> StateUpdate { + if matches!(rc.game.state, GameState::Playing) + && cancel_button_with_tooltip(rc, "Back to playing actions") + { + return StateUpdate::CloseDialog; + } + StateUpdate::None +} diff --git a/client/src/player_ui.rs b/client/src/player_ui.rs index 2f61be29..37689c1d 100644 --- a/client/src/player_ui.rs +++ b/client/src/player_ui.rs @@ -8,7 +8,7 @@ use crate::layout_ui::{ }; use crate::map_ui::terrain_name; use crate::render_context::RenderContext; -use crate::resource_ui::resource_name; +use crate::resource_ui::{new_resource_map, resource_name}; use crate::tooltip::show_tooltip_for_rect; use crate::unit_ui; use macroquad::math::vec2; @@ -17,7 +17,7 @@ use server::action::Action; use server::consts::ARMY_MOVEMENT_REQUIRED_ADVANCE; use server::game::{CurrentMove, Game, GameState, MoveState}; use server::playing_actions::PlayingAction; -use server::resource::{new_resource_map, resource_types}; +use server::resource::resource_types; use server::unit::MovementAction; pub fn player_select(rc: &RenderContext) -> StateUpdate { diff --git a/client/src/resource_ui.rs b/client/src/resource_ui.rs index e9d32ef7..33a7ad5c 100644 --- a/client/src/resource_ui.rs +++ b/client/src/resource_ui.rs @@ -2,8 +2,9 @@ use crate::layout_ui::icon_pos; use crate::player_ui::bottom_icon_with_label; use crate::render_context::RenderContext; use macroquad::math::vec2; -use server::resource::{new_resource_map, resource_types, ResourceType}; +use server::resource::{resource_types, ResourceType}; use server::resource_pile::ResourcePile; +use std::collections::HashMap; pub fn resource_name(t: ResourceType) -> &'static str { match t { @@ -18,6 +19,24 @@ pub fn resource_name(t: ResourceType) -> &'static str { } } +#[must_use] +pub fn new_resource_map(p: &ResourcePile) -> HashMap { + let mut m: HashMap = HashMap::new(); + add_resource(&mut m, p.food, ResourceType::Food); + add_resource(&mut m, p.wood, ResourceType::Wood); + add_resource(&mut m, p.ore, ResourceType::Ore); + add_resource(&mut m, p.ideas, ResourceType::Ideas); + add_resource(&mut m, p.gold as u32, ResourceType::Gold); + add_resource(&mut m, p.mood_tokens, ResourceType::MoodTokens); + add_resource(&mut m, p.culture_tokens, ResourceType::CultureTokens); + add_resource(&mut m, 0, ResourceType::Discount); + m +} + +fn add_resource(m: &mut HashMap, amount: u32, resource_type: ResourceType) { + m.insert(resource_type, amount); +} + pub fn show_resource_pile(rc: &RenderContext, p: &ResourcePile, must_show: &[ResourceType]) { let resource_map = new_resource_map(p); let show: Vec = resource_types() diff --git a/server/src/game.rs b/server/src/game.rs index f9693c36..f94015ae 100644 --- a/server/src/game.rs +++ b/server/src/game.rs @@ -6,9 +6,10 @@ use std::mem; use GameState::*; use crate::combat::{self, Combat, CombatDieRoll, CombatPhase, COMBAT_DIE_SIDES}; +use crate::consts::MOVEMENT_ACTIONS; use crate::explore::{explore_resolution, move_to_unexplored_tile, undo_explore_resolution}; use crate::map::UnexploredBlock; -use crate::movement::terrain_movement_restriction; +use crate::movement::{has_movable_units, terrain_movement_restriction}; use crate::resource::check_for_waste; use crate::unit::{carried_units, get_current_move, MovementRestriction}; use crate::utils::Rng; @@ -303,7 +304,7 @@ impl Game { self.undo(player_index); return; } - if matches!(action, Action::Redo) || self.can_auto_redo(&action) { + if matches!(action, Action::Redo) { assert!(self.can_redo(), "no action can be redone"); self.redo(player_index); return; @@ -312,9 +313,13 @@ impl Game { self.add_action_log_item(action.clone()); match self.state.clone() { Playing => { - let action = action.playing().expect("action should be a playing action"); + if let Some(m) = action.clone().movement() { + self.execute_movement_action(m, player_index, MoveState::new()); + } else { + let action = action.playing().expect("action should be a playing action"); - action.execute(self, player_index); + action.execute(self, player_index); + } } StatusPhase(phase) => { let action = action @@ -358,17 +363,6 @@ impl Game { check_for_waste(self, player_index); } - fn can_auto_redo(&mut self, action: &Action) -> bool { - self.state.is_playing() - && self.can_redo() - && self.action_log[self.action_log_index] - .playing_ref() - .expect("undone actions should be playing actions") - == action - .playing_ref() - .expect("action should be a playing action") - } - fn undo(&mut self, player_index: usize) { match &self.action_log[self.action_log_index - 1] { Action::Playing(action) => action.clone().undo(self, player_index), @@ -403,14 +397,17 @@ impl Game { match action_log_item { Action::Playing(action) => action.clone().execute(self, player_index), Action::StatusPhase(_) => panic!("status phase actions can't be redone"), - Action::Movement(action) => { - let Movement(m) = &self.state else { - panic!( - "movement actions can only be redone if the game is in a movement state" - ); - }; - self.execute_movement_action(action.clone(), player_index, m.clone()); - } + Action::Movement(action) => match &self.state { + Playing => { + self.execute_movement_action(action.clone(), player_index, MoveState::new()); + } + Movement(m) => { + self.execute_movement_action(action.clone(), player_index, m.clone()); + } + _ => { + panic!("movement actions can only be redone if the game is in a movement state") + } + }, Action::CulturalInfluenceResolution(action) => { let CulturalInfluenceResolution(c) = &self.state else { panic!("cultural influence resolution actions can only be redone if the game is in a cultural influence resolution state"); @@ -463,6 +460,10 @@ impl Game { destination, embark_carrier_id, } => { + if let Playing = self.state { + assert_ne!(self.actions_left, 0, "Illegal action"); + self.actions_left -= 1; + } let player = &self.players[player_index]; let starting_position = player .get_unit(*units.first().expect( @@ -675,7 +676,12 @@ impl Game { .carrier_id = Some(unit.carrier_id); } } - self.state = Movement(move_state); + if move_state.movement_actions_left == MOVEMENT_ACTIONS { + self.state = Playing; + self.actions_left += 1; + } else { + self.state = Movement(move_state); + } } fn execute_cultural_influence_resolution_action( @@ -739,17 +745,18 @@ impl Game { } pub(crate) fn back_to_move(&mut self, move_state: &MoveState, stop_current_move: bool) { - self.state = if move_state.movement_actions_left == 0 - && move_state.current_move == CurrentMove::None - { - Playing - } else { - let mut state = move_state.clone(); - if stop_current_move { - state.current_move = CurrentMove::None; - } - Movement(state) - }; + let mut state = move_state.clone(); + if stop_current_move { + state.current_move = CurrentMove::None; + } + // set state to Movement first, because that affects has_movable_units + self.state = Movement(state); + + let all_moves_used = + move_state.movement_actions_left == 0 && move_state.current_move == CurrentMove::None; + if all_moves_used || !has_movable_units(self, self.get_player(self.current_player_index)) { + self.state = Playing; + } } #[must_use] @@ -1598,6 +1605,23 @@ pub struct MoveState { pub current_move: CurrentMove, } +impl Default for MoveState { + fn default() -> Self { + Self::new() + } +} + +impl MoveState { + #[must_use] + pub fn new() -> Self { + MoveState { + movement_actions_left: MOVEMENT_ACTIONS, + moved_units: Vec::new(), + current_move: CurrentMove::None, + } + } +} + #[derive(Serialize, Deserialize, Clone, PartialEq, Eq, Debug)] pub struct PlaceSettlerState { pub player_index: usize, diff --git a/server/src/log.rs b/server/src/log.rs index a71996b1..9a0ecc01 100644 --- a/server/src/log.rs +++ b/server/src/log.rs @@ -95,7 +95,6 @@ fn format_playing_action_log_item(action: &PlayingAction, game: &Game) -> String PlayingAction::Construct(c) => format_construct_log_item(game, player, &player_name, c), PlayingAction::Collect(c) => format_collect_log_item(player, &player_name, c), PlayingAction::Recruit(r) => format_recruit_log_item(player, &player_name, r), - PlayingAction::MoveUnits => format!("{player_name} used a move units action"), PlayingAction::IncreaseHappiness(i) => format_happiness_increase(player, &player_name, i), PlayingAction::InfluenceCultureAttempt(c) => { format_cultural_influence_attempt_log_item(game, &player_name, c) diff --git a/server/src/movement.rs b/server/src/movement.rs index 4c5978fb..b0ae0dc7 100644 --- a/server/src/movement.rs +++ b/server/src/movement.rs @@ -209,3 +209,22 @@ pub(crate) fn terrain_movement_restriction( _ => None, } } + +pub(crate) fn has_movable_units(game: &Game, player: &Player) -> bool { + player.units.iter().any(|unit| { + player + .move_units_destinations(game, &[unit.id], unit.position, None) + .is_ok() + || can_embark(game, player, unit) + }) +} + +fn can_embark(game: &Game, player: &Player, unit: &Unit) -> bool { + unit.unit_type.is_land_based() + && player.units.iter().any(|u| { + u.unit_type.is_ship() + && player + .move_units_destinations(game, &[unit.id], u.position, Some(u.id)) + .is_ok() + }) +} diff --git a/server/src/player.rs b/server/src/player.rs index 7051f6cb..a3a75d8b 100644 --- a/server/src/player.rs +++ b/server/src/player.rs @@ -898,6 +898,9 @@ impl Player { .cloned() .collect(); + if destinations.is_empty() { + return Err("no valid destinations".to_string()); + } Ok(destinations) } diff --git a/server/src/playing_actions.rs b/server/src/playing_actions.rs index 8f5dd1f4..082e67b4 100644 --- a/server/src/playing_actions.rs +++ b/server/src/playing_actions.rs @@ -6,11 +6,11 @@ use PlayingAction::*; use crate::action::Action; use crate::content::advances; -use crate::game::{CulturalInfluenceResolution, CurrentMove, GameState, MoveState}; +use crate::game::{CulturalInfluenceResolution, GameState}; use crate::{ city::City, city_pieces::Building::{self, *}, - consts::{MOVEMENT_ACTIONS, PORT_CHOICES}, + consts::PORT_CHOICES, content::custom_actions::CustomAction, game::{Game, UndoContext}, map::Terrain, @@ -94,7 +94,6 @@ pub enum PlayingAction { Construct(Construct), Collect(Collect), Recruit(Recruit), - MoveUnits, IncreaseHappiness(IncreaseHappiness), InfluenceCultureAttempt(InfluenceCultureAttempt), Custom(CustomAction), @@ -204,13 +203,6 @@ impl PlayingAction { r.replaced_units, ); } - MoveUnits => { - game.state = GameState::Movement(MoveState { - movement_actions_left: MOVEMENT_ACTIONS, - moved_units: Vec::new(), - current_move: CurrentMove::None, - }); - } IncreaseHappiness(i) => { increase_happiness(game, player_index, i); } @@ -301,7 +293,6 @@ impl PlayingAction { PlayingAction::Construct { .. } => PlayingActionType::Construct, PlayingAction::Collect { .. } => PlayingActionType::Collect, PlayingAction::Recruit { .. } => PlayingActionType::Recruit, - PlayingAction::MoveUnits => PlayingActionType::MoveUnits, PlayingAction::IncreaseHappiness { .. } => PlayingActionType::IncreaseHappiness, PlayingAction::InfluenceCultureAttempt { .. } => { PlayingActionType::InfluenceCultureAttempt @@ -357,7 +348,6 @@ impl PlayingAction { game.players[player_index].gain_resources(r.payment); game.undo_recruit(player_index, &r.units, r.city_position, r.leader_index); } - MoveUnits => game.state = GameState::Playing, IncreaseHappiness(i) => undo_increase_happiness(game, player_index, i), Custom(custom_action) => custom_action.undo(game, player_index), InfluenceCultureAttempt(_) | EndTurn => panic!("Action can't be undone"), diff --git a/server/src/resource.rs b/server/src/resource.rs index 48622378..0ae4d90c 100644 --- a/server/src/resource.rs +++ b/server/src/resource.rs @@ -1,7 +1,6 @@ use crate::game::{Game, UndoContext}; use crate::resource_pile::ResourcePile; -use std::collections::HashMap; -use std::fmt; +use std::{fmt, mem}; #[derive(PartialEq, Eq, Debug, Clone, Copy, Hash, Ord, PartialOrd)] pub enum ResourceType { @@ -34,37 +33,19 @@ impl fmt::Display for ResourceType { } } -#[must_use] -pub fn new_resource_map(p: &ResourcePile) -> HashMap { - let mut m: HashMap = HashMap::new(); - add_resource(&mut m, p.food, ResourceType::Food); - add_resource(&mut m, p.wood, ResourceType::Wood); - add_resource(&mut m, p.ore, ResourceType::Ore); - add_resource(&mut m, p.ideas, ResourceType::Ideas); - add_resource(&mut m, p.gold as u32, ResourceType::Gold); - add_resource(&mut m, p.mood_tokens, ResourceType::MoodTokens); - add_resource(&mut m, p.culture_tokens, ResourceType::CultureTokens); - m -} - -fn add_resource(m: &mut HashMap, amount: u32, resource_type: ResourceType) { - m.insert(resource_type, amount); -} - pub(crate) fn check_for_waste(game: &mut Game, player_index: usize) { - let mut wasted_resources = ResourcePile::empty(); - for p in &mut game.players { - if p.wasted_resources.is_empty() { - continue; - } - assert_eq!( - p.index, player_index, - "non-active player {} has wasted resources: {:?}", - p.index, p.wasted_resources + for p in &game.players { + assert!( + p.wasted_resources.is_empty() || p.index == player_index, + "non-active Player {} has wasted resources: {:?}", + p.index, + p.wasted_resources ); - wasted_resources = p.wasted_resources.clone(); - p.wasted_resources = ResourcePile::empty(); } + let wasted_resources = mem::replace( + &mut game.players[player_index].wasted_resources, + ResourcePile::empty(), + ); if !wasted_resources.is_empty() { game.push_undo_context(UndoContext::WastedResources { resources: wasted_resources, diff --git a/server/tests/game_api_tests.rs b/server/tests/game_api_tests.rs index 1ed99d22..06fd281f 100644 --- a/server/tests/game_api_tests.rs +++ b/server/tests/game_api_tests.rs @@ -187,7 +187,6 @@ fn basic_actions() { .expect("The player should have a city at this position") .is_activated()); - let game = game_api::execute_action(game, Action::Playing(MoveUnits), 0); let movement_action = move_action(vec![0], founded_city_position); let game = game_api::execute_action(game, movement_action, 0); let game = game_api::execute_action(game, Action::Movement(Stop), 0); @@ -302,11 +301,11 @@ fn assert_undo( action_log_index: usize, undo_limit: usize, ) { - assert_eq!(can_undo, game.can_undo()); - assert_eq!(can_redo, game.can_redo()); - assert_eq!(action_log_len, game.action_log.len()); - assert_eq!(action_log_index, game.action_log_index); - assert_eq!(undo_limit, game.undo_limit); + assert_eq!(can_undo, game.can_undo(), "can_undo"); + assert_eq!(can_redo, game.can_redo(), "can_redo"); + assert_eq!(action_log_len, game.action_log.len(), "action_log_len"); + assert_eq!(action_log_index, game.action_log_index, "action_log_index"); + assert_eq!(undo_limit, game.undo_limit, "undo_limit"); } fn increase_happiness(game: Game) -> Game { @@ -340,7 +339,7 @@ fn undo() { let game = game_api::execute_action(game, Action::Undo, 0); assert_undo(&game, false, true, 2, 0, 0); assert_eq!(Angry, game.players[0].cities[0].mood_state); - let game = increase_happiness(game); + let game = game_api::execute_action(game, Action::Redo, 0); assert_undo(&game, true, true, 2, 1, 0); assert_eq!(Neutral, game.players[0].cities[0].mood_state); let game = game_api::execute_action(game, Action::Redo, 0); diff --git a/server/tests/test_games/custom_action_forced_labor.json b/server/tests/test_games/custom_action_forced_labor.json index 693be11b..1ab26726 100644 --- a/server/tests/test_games/custom_action_forced_labor.json +++ b/server/tests/test_games/custom_action_forced_labor.json @@ -363,26 +363,17 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": "Stop" } ], - "action_log_index": 15, + "action_log_index": 12, "log": [ "The game has started", "Age 1 has started", @@ -471,18 +462,18 @@ }, { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } } ] -} \ No newline at end of file +} diff --git a/server/tests/test_games/custom_action_forced_labor.outcome.json b/server/tests/test_games/custom_action_forced_labor.outcome.json index f3b6bc29..765ca4d5 100644 --- a/server/tests/test_games/custom_action_forced_labor.outcome.json +++ b/server/tests/test_games/custom_action_forced_labor.outcome.json @@ -366,21 +366,12 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": "Stop" }, @@ -390,7 +381,7 @@ } } ], - "action_log_index": 16, + "action_log_index": 13, "log": [ "The game has started", "Age 1 has started", @@ -480,18 +471,18 @@ }, { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } } ] -} \ No newline at end of file +} diff --git a/server/tests/test_games/direct_capture_city.json b/server/tests/test_games/direct_capture_city.json index 1992bf2c..ad744c6c 100644 --- a/server/tests/test_games/direct_capture_city.json +++ b/server/tests/test_games/direct_capture_city.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, "players": [ @@ -331,12 +331,9 @@ } } } - }, - { - "Playing": "MoveUnits" } ], - "action_log_index": 2, + "action_log_index": 1, "log": [ "The game has started", "Age 1 has started", diff --git a/server/tests/test_games/direct_capture_city.outcome.json b/server/tests/test_games/direct_capture_city.outcome.json index 78376c61..1cd8fd4f 100644 --- a/server/tests/test_games/direct_capture_city.outcome.json +++ b/server/tests/test_games/direct_capture_city.outcome.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 2, + "movement_actions_left": 1, "moved_units": [ 0, 1, @@ -278,9 +278,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -295,7 +292,7 @@ } } ], - "action_log_index": 3, + "action_log_index": 2, "log": [ "The game has started", "Age 1 has started", @@ -307,7 +304,7 @@ "\tPlayer1 rolled 2 (Elephant, -1 hits, no combat value), 2 (Elephant, no bonus), 2 (Elephant, no bonus), 1 (Leader, re-roll), 1 (Leader, re-roll), 6 (Infantry, +1 combat value) for combined combat value of 11 and gets 2 hits against defending units. Player2 rolled 6 (Infantry, no bonus) for combined combat value of 6 and gets 0 hits against attacking units.", "\tPlayer1 killed all defending units and captured Player2's city at C1" ], - "undo_limit": 3, + "undo_limit": 2, "actions_left": 1, "successful_cultural_influence": false, "round": 1, @@ -372,7 +369,7 @@ { "Movement": { "starting_position": "C2", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { diff --git a/server/tests/test_games/direct_capture_city_fortress.json b/server/tests/test_games/direct_capture_city_fortress.json index 59167826..60be160e 100644 --- a/server/tests/test_games/direct_capture_city_fortress.json +++ b/server/tests/test_games/direct_capture_city_fortress.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 3} + "movement_actions_left": 2} }, "players": [ { @@ -337,12 +337,9 @@ } } } - }, - { - "Playing": "MoveUnits" } ], - "action_log_index": 2, + "action_log_index": 1, "log": [ "The game has started", "Age 1 has started", diff --git a/server/tests/test_games/direct_capture_city_fortress.outcome.json b/server/tests/test_games/direct_capture_city_fortress.outcome.json index e9158984..05abd863 100644 --- a/server/tests/test_games/direct_capture_city_fortress.outcome.json +++ b/server/tests/test_games/direct_capture_city_fortress.outcome.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 2, + "movement_actions_left": 1, "moved_units": [ 0, 1, @@ -278,9 +278,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -295,7 +292,7 @@ } } ], - "action_log_index": 3, + "action_log_index": 2, "log": [ "The game has started", "Age 1 has started", @@ -307,7 +304,7 @@ "\tPlayer1 rolled 6 (Infantry, +1 combat value), 6 (Infantry, no bonus), 6 (Infantry, no bonus), 6 (Infantry, no bonus) for combined combat value of 25 and gets 4 hits against defending units. Player2 rolled 1 (Leader, no bonus), 1 (Leader, no bonus) for combined combat value of 2 and gets 0 hits against attacking units.", "\tPlayer1 killed all defending units and captured Player2's city at C1" ], - "undo_limit": 3, + "undo_limit": 2, "actions_left": 1, "successful_cultural_influence": false, "round": 1, @@ -367,7 +364,7 @@ { "Movement": { "starting_position": "C2", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { diff --git a/server/tests/test_games/direct_capture_city_only_fortress.json b/server/tests/test_games/direct_capture_city_only_fortress.json index 8dcb3c4b..6d28b3e2 100644 --- a/server/tests/test_games/direct_capture_city_only_fortress.json +++ b/server/tests/test_games/direct_capture_city_only_fortress.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, "players": [ @@ -324,9 +324,6 @@ } } } - }, - { - "Playing": "MoveUnits" } ], "action_log_index": 2, diff --git a/server/tests/test_games/direct_capture_city_only_fortress.outcome.json b/server/tests/test_games/direct_capture_city_only_fortress.outcome.json index 12611c28..0a686bd0 100644 --- a/server/tests/test_games/direct_capture_city_only_fortress.outcome.json +++ b/server/tests/test_games/direct_capture_city_only_fortress.outcome.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 2, + "movement_actions_left": 1, "moved_units": [ 0, 1, @@ -278,9 +278,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -367,7 +364,7 @@ { "Movement": { "starting_position": "C2", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { diff --git a/server/tests/test_games/dont_retreat.json b/server/tests/test_games/dont_retreat.json index 5ae0aff0..b6c6385c 100644 --- a/server/tests/test_games/dont_retreat.json +++ b/server/tests/test_games/dont_retreat.json @@ -356,9 +356,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { diff --git a/server/tests/test_games/dont_retreat.outcome.json b/server/tests/test_games/dont_retreat.outcome.json index fde148b4..0332bf7e 100644 --- a/server/tests/test_games/dont_retreat.outcome.json +++ b/server/tests/test_games/dont_retreat.outcome.json @@ -307,9 +307,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -400,4 +397,4 @@ "Recruit": {} } ] -} \ No newline at end of file +} diff --git a/server/tests/test_games/explore_auto_adjacent_water.json b/server/tests/test_games/explore_auto_adjacent_water.json index a74123d9..b5a315e7 100644 --- a/server/tests/test_games/explore_auto_adjacent_water.json +++ b/server/tests/test_games/explore_auto_adjacent_water.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 3} + "movement_actions_left": 2} }, "players": [ { @@ -478,9 +478,6 @@ "starting_player_index": 0, "current_player_index": 0, "action_log": [ - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -494,9 +491,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -516,9 +510,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -532,9 +523,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -551,9 +539,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -573,9 +558,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -589,9 +571,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -605,9 +584,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -645,9 +621,6 @@ "DetermineFirstPlayer": 0 } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -660,9 +633,6 @@ }, { "Movement": "Stop" - }, - { - "Playing": "MoveUnits" } ], "action_log_index": 39, @@ -943,7 +913,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { @@ -956,7 +926,7 @@ { "Movement": { "starting_position": "C2", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { @@ -969,7 +939,7 @@ { "Movement": { "starting_position": "B2", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { @@ -990,7 +960,7 @@ { "Movement": { "starting_position": "C4", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { @@ -1003,7 +973,7 @@ { "Movement": { "starting_position": "B4", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { @@ -1016,7 +986,7 @@ { "Movement": { "starting_position": "C4", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { @@ -1037,7 +1007,7 @@ { "Movement": { "starting_position": "D5", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { diff --git a/server/tests/test_games/explore_auto_adjacent_water.outcome.json b/server/tests/test_games/explore_auto_adjacent_water.outcome.json index d9bcb826..aacca3a6 100644 --- a/server/tests/test_games/explore_auto_adjacent_water.outcome.json +++ b/server/tests/test_games/explore_auto_adjacent_water.outcome.json @@ -1,12 +1,5 @@ { - "state": { - "Movement": { - "movement_actions_left": 2, - "moved_units": [ - 0 - ] - } - }, + "state": "Playing", "players": [ { "name": null, @@ -406,9 +399,6 @@ "starting_player_index": 0, "current_player_index": 0, "action_log": [ - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -422,9 +412,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -444,9 +431,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -460,9 +444,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -479,9 +460,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -501,9 +479,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -517,9 +492,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -533,9 +505,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -573,9 +542,6 @@ "DetermineFirstPlayer": 0 } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -589,9 +555,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -882,7 +845,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -896,7 +859,7 @@ { "Movement": { "starting_position": "C2", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -910,7 +873,7 @@ { "Movement": { "starting_position": "B2", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -932,7 +895,7 @@ { "Movement": { "starting_position": "C4", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -946,7 +909,7 @@ { "Movement": { "starting_position": "B4", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -960,7 +923,7 @@ { "Movement": { "starting_position": "C4", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -982,7 +945,7 @@ { "Movement": { "starting_position": "D5", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { diff --git a/server/tests/test_games/explore_auto_no_walk_on_water.json b/server/tests/test_games/explore_auto_no_walk_on_water.json index 994bd285..5051d1f1 100644 --- a/server/tests/test_games/explore_auto_no_walk_on_water.json +++ b/server/tests/test_games/explore_auto_no_walk_on_water.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 3} + "movement_actions_left": 2} }, "players": [ { @@ -490,9 +490,6 @@ "starting_player_index": 0, "current_player_index": 0, "action_log": [ - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -505,9 +502,6 @@ }, { "Movement": "Stop" - }, - { - "Playing": "MoveUnits" } ], "action_log_index": 4, @@ -740,7 +734,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { diff --git a/server/tests/test_games/explore_auto_no_walk_on_water.outcome.json b/server/tests/test_games/explore_auto_no_walk_on_water.outcome.json index 0ba6f15b..e0e05380 100644 --- a/server/tests/test_games/explore_auto_no_walk_on_water.outcome.json +++ b/server/tests/test_games/explore_auto_no_walk_on_water.outcome.json @@ -1,12 +1,5 @@ { - "state": { - "Movement": { - "movement_actions_left": 2, - "moved_units": [ - 0 - ] - } - }, + "state": "Playing", "players": [ { "name": null, @@ -425,9 +418,6 @@ "starting_player_index": 0, "current_player_index": 0, "action_log": [ - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -441,9 +431,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -686,7 +673,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { diff --git a/server/tests/test_games/explore_auto_water_outside.json b/server/tests/test_games/explore_auto_water_outside.json index 514cdff9..becf3c91 100644 --- a/server/tests/test_games/explore_auto_water_outside.json +++ b/server/tests/test_games/explore_auto_water_outside.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 3} + "movement_actions_left": 2} }, "players": [ { @@ -480,9 +480,6 @@ "starting_player_index": 0, "current_player_index": 1, "action_log": [ - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -496,9 +493,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -518,9 +512,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -534,9 +525,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -553,9 +541,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -575,9 +560,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -591,9 +573,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -607,9 +586,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -647,9 +623,6 @@ "DetermineFirstPlayer": 0 } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -663,9 +636,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -689,9 +659,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -705,9 +672,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -752,9 +716,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -825,9 +786,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -844,9 +802,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -865,9 +820,6 @@ }, { "Playing": "EndTurn" - }, - { - "Playing": "MoveUnits" } ], "action_log_index": 68, @@ -1184,7 +1136,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { @@ -1197,7 +1149,7 @@ { "Movement": { "starting_position": "C2", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { @@ -1210,7 +1162,7 @@ { "Movement": { "starting_position": "B2", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { @@ -1231,7 +1183,7 @@ { "Movement": { "starting_position": "C4", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { @@ -1244,7 +1196,7 @@ { "Movement": { "starting_position": "B4", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { @@ -1257,7 +1209,7 @@ { "Movement": { "starting_position": "C4", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { @@ -1278,7 +1230,7 @@ { "Movement": { "starting_position": "D5", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { @@ -1291,7 +1243,7 @@ { "Movement": { "starting_position": "C6", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { @@ -1317,7 +1269,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { @@ -1330,7 +1282,7 @@ { "Movement": { "starting_position": "E8", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { @@ -1362,7 +1314,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { @@ -1381,7 +1333,7 @@ { "Movement": { "starting_position": "E7", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { diff --git a/server/tests/test_games/explore_auto_water_outside.outcome.json b/server/tests/test_games/explore_auto_water_outside.outcome.json index 5515db9c..134d8e3a 100644 --- a/server/tests/test_games/explore_auto_water_outside.outcome.json +++ b/server/tests/test_games/explore_auto_water_outside.outcome.json @@ -1,12 +1,5 @@ { - "state": { - "Movement": { - "movement_actions_left": 2, - "moved_units": [ - 1 - ] - } - }, + "state": "Playing", "players": [ { "name": null, @@ -411,9 +404,6 @@ "starting_player_index": 0, "current_player_index": 1, "action_log": [ - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -427,9 +417,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -449,9 +436,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -465,9 +449,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -484,9 +465,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -506,9 +484,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -522,9 +497,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -538,9 +510,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -578,9 +547,6 @@ "DetermineFirstPlayer": 0 } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -594,9 +560,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -620,9 +583,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -636,9 +596,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -677,9 +634,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -732,9 +686,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -751,9 +702,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -773,9 +721,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -1102,7 +1047,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1116,7 +1061,7 @@ { "Movement": { "starting_position": "C2", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1130,7 +1075,7 @@ { "Movement": { "starting_position": "B2", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1152,7 +1097,7 @@ { "Movement": { "starting_position": "C4", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1166,7 +1111,7 @@ { "Movement": { "starting_position": "B4", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1180,7 +1125,7 @@ { "Movement": { "starting_position": "C4", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1202,7 +1147,7 @@ { "Movement": { "starting_position": "D5", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1216,7 +1161,7 @@ { "Movement": { "starting_position": "C6", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1240,7 +1185,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1254,7 +1199,7 @@ { "Movement": { "starting_position": "E8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1281,7 +1226,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1298,7 +1243,7 @@ { "Movement": { "starting_position": "E7", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { diff --git a/server/tests/test_games/explore_choose.json b/server/tests/test_games/explore_choose.json index cdecc438..da5dcb98 100644 --- a/server/tests/test_games/explore_choose.json +++ b/server/tests/test_games/explore_choose.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 3} + "movement_actions_left": 2} }, "players": [ { @@ -488,9 +488,6 @@ "starting_player_index": 1, "current_player_index": 1, "action_log": [ - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -503,9 +500,6 @@ }, { "Movement": "Stop" - }, - { - "Playing": "MoveUnits" } ], "action_log_index": 4, @@ -738,7 +732,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3} + "movement_actions_left": 2} }, { "Movement": { diff --git a/server/tests/test_games/explore_choose.outcome.json b/server/tests/test_games/explore_choose.outcome.json index 8c97c0fd..0bc4ed21 100644 --- a/server/tests/test_games/explore_choose.outcome.json +++ b/server/tests/test_games/explore_choose.outcome.json @@ -1,7 +1,7 @@ { "state": { "ExploreResolution": { - "movement_actions_left": 2, + "movement_actions_left": 1, "moved_units": [ 0 ], @@ -456,9 +456,6 @@ "starting_player_index": 1, "current_player_index": 1, "action_log": [ - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -472,9 +469,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -717,7 +711,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { diff --git a/server/tests/test_games/explore_resolution.json b/server/tests/test_games/explore_resolution.json index 4c6f617e..ba3b9e19 100644 --- a/server/tests/test_games/explore_resolution.json +++ b/server/tests/test_games/explore_resolution.json @@ -456,9 +456,6 @@ "starting_player_index": 1, "current_player_index": 1, "action_log": [ - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -472,9 +469,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -486,7 +480,7 @@ } } ], - "action_log_index": 5, + "action_log_index": 3, "log": [ "The game has started", "Age 1 has started", @@ -497,7 +491,7 @@ "Player2 used a move units action", "\tPlayer2 moved 1 settler from D7 to C7" ], - "undo_limit": 5, + "undo_limit": 3, "actions_left": 1, "successful_cultural_influence": false, "round": 1, @@ -717,7 +711,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -729,4 +723,4 @@ } } ] -} \ No newline at end of file +} diff --git a/server/tests/test_games/explore_resolution.outcome.json b/server/tests/test_games/explore_resolution.outcome.json index 949631a4..2acba761 100644 --- a/server/tests/test_games/explore_resolution.outcome.json +++ b/server/tests/test_games/explore_resolution.outcome.json @@ -1,12 +1,5 @@ { - "state": { - "Movement": { - "movement_actions_left": 2, - "moved_units": [ - 0 - ] - } - }, + "state": "Playing", "players": [ { "name": null, @@ -422,9 +415,6 @@ "starting_player_index": 1, "current_player_index": 1, "action_log": [ - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -438,9 +428,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -455,7 +442,7 @@ "ExploreResolution": 3 } ], - "action_log_index": 6, + "action_log_index": 4, "log": [ "The game has started", "Age 1 has started", @@ -467,7 +454,7 @@ "\tPlayer2 moved 1 settler from D7 to C7", "Player2 chose the orientation of the newly explored tiles. Explored tiles A7=Fertile, B6=Barren, B7=Water, C7=Fertile" ], - "undo_limit": 5, + "undo_limit": 3, "actions_left": 1, "successful_cultural_influence": false, "round": 1, @@ -687,7 +674,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { diff --git a/server/tests/test_games/first_combat_round_no_hits.json b/server/tests/test_games/first_combat_round_no_hits.json index 2a28b2e0..7680e6e3 100644 --- a/server/tests/test_games/first_combat_round_no_hits.json +++ b/server/tests/test_games/first_combat_round_no_hits.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 3} + "movement_actions_left": 2} }, "players": [ { @@ -337,9 +337,6 @@ } } } - }, - { - "Playing": "MoveUnits" } ], "action_log_index": 2, diff --git a/server/tests/test_games/first_combat_round_no_hits.outcome.json b/server/tests/test_games/first_combat_round_no_hits.outcome.json index 56a72eae..0a6ab263 100644 --- a/server/tests/test_games/first_combat_round_no_hits.outcome.json +++ b/server/tests/test_games/first_combat_round_no_hits.outcome.json @@ -3,7 +3,7 @@ "Combat": { "initiation": { "Movement": { - "movement_actions_left": 2, + "movement_actions_left": 1, "moved_units": [ 0 ] @@ -301,9 +301,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { diff --git a/server/tests/test_games/found_city.json b/server/tests/test_games/found_city.json index 56e6c009..265d3f1c 100644 --- a/server/tests/test_games/found_city.json +++ b/server/tests/test_games/found_city.json @@ -269,9 +269,6 @@ "starting_player_index": 0, "current_player_index": 0, "action_log": [ - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -286,7 +283,7 @@ "Movement": "Stop" } ], - "action_log_index": 3, + "action_log_index": 2, "log": [ "The game has started", "Age 1 has started", @@ -355,7 +352,7 @@ { "Movement": { "starting_position": "C2", - "movement_actions_left": 3, + "movement_actions_left": 2, "moved_units": [ 4 ] @@ -370,4 +367,4 @@ } } ] -} \ No newline at end of file +} diff --git a/server/tests/test_games/found_city.outcome.json b/server/tests/test_games/found_city.outcome.json index 302b0c87..7069d177 100644 --- a/server/tests/test_games/found_city.outcome.json +++ b/server/tests/test_games/found_city.outcome.json @@ -271,9 +271,6 @@ "starting_player_index": 0, "current_player_index": 0, "action_log": [ - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -295,7 +292,7 @@ } } ], - "action_log_index": 4, + "action_log_index": 3, "log": [ "The game has started", "Age 1 has started", @@ -365,7 +362,7 @@ { "Movement": { "starting_position": "C2", - "movement_actions_left": 3, + "movement_actions_left": 2, "moved_units": [ 4 ] @@ -390,4 +387,4 @@ } } ] -} \ No newline at end of file +} diff --git a/server/tests/test_games/movement.json b/server/tests/test_games/movement.json index df670395..47b8febd 100644 --- a/server/tests/test_games/movement.json +++ b/server/tests/test_games/movement.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, "players": [ @@ -341,7 +341,7 @@ { "Movement": { "starting_position": "C2", - "movement_actions_left": 3, + "movement_actions_left": 2, "moved_units": [ 4 ] @@ -356,4 +356,4 @@ } } ] -} \ No newline at end of file +} diff --git a/server/tests/test_games/movement.outcome.json b/server/tests/test_games/movement.outcome.json index 54acbbd4..a37aca8c 100644 --- a/server/tests/test_games/movement.outcome.json +++ b/server/tests/test_games/movement.outcome.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 2, + "movement_actions_left": 1, "moved_units": [ 4 ] @@ -356,7 +356,7 @@ { "Movement": { "starting_position": "C2", - "movement_actions_left": 3, + "movement_actions_left": 2, "moved_units": [ 4 ] @@ -373,8 +373,8 @@ { "Movement": { "starting_position": "B2", - "movement_actions_left": 3 + "movement_actions_left": 2 } } ] -} \ No newline at end of file +} diff --git a/server/tests/test_games/movement_on_roads_from_city.json b/server/tests/test_games/movement_on_roads_from_city.json index 21784c86..6b9d1f7b 100644 --- a/server/tests/test_games/movement_on_roads_from_city.json +++ b/server/tests/test_games/movement_on_roads_from_city.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, "players": [ @@ -425,9 +425,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -441,9 +438,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -481,9 +475,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -497,9 +488,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -537,9 +525,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": "Stop" }, @@ -570,9 +555,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -636,12 +618,9 @@ ] } } - }, - { - "Playing": "MoveUnits" } ], - "action_log_index": 33, + "action_log_index": 26, "log": [ "The game has started", "Age 1 has started", @@ -693,8 +672,8 @@ "Player2 collects 1 ore in the city at D8", "Player2 used a move units action" ], - "undo_limit": 31, - "actions_left": 1, + "undo_limit": 24, + "actions_left": 0, "successful_cultural_influence": false, "round": 1, "age": 2, @@ -714,7 +693,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -736,7 +715,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -757,13 +736,13 @@ }, { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { "Movement": { "starting_position": "F7", - "movement_actions_left": 3, + "movement_actions_left": 2, "cost": { "wood": 1, "ore": 1 @@ -779,4 +758,4 @@ } } ] -} \ No newline at end of file +} diff --git a/server/tests/test_games/movement_on_roads_from_city.outcome.json b/server/tests/test_games/movement_on_roads_from_city.outcome.json index 29620896..85724c47 100644 --- a/server/tests/test_games/movement_on_roads_from_city.outcome.json +++ b/server/tests/test_games/movement_on_roads_from_city.outcome.json @@ -1,12 +1,5 @@ { - "state": { - "Movement": { - "movement_actions_left": 2, - "moved_units": [ - 0 - ] - } - }, + "state": "Playing", "players": [ { "name": null, @@ -426,9 +419,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -442,9 +432,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -482,9 +469,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -498,9 +482,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -538,9 +519,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": "Stop" }, @@ -571,9 +549,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -638,9 +613,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -652,7 +624,7 @@ } } ], - "action_log_index": 34, + "action_log_index": 27, "log": [ "The game has started", "Age 1 has started", @@ -705,8 +677,8 @@ "Player2 used a move units action", "\tPlayer2 marched 1 settler from D8 to F7 on roads" ], - "undo_limit": 31, - "actions_left": 1, + "undo_limit": 24, + "actions_left": 0, "successful_cultural_influence": false, "round": 1, "age": 2, @@ -726,7 +698,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -748,7 +720,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -769,13 +741,13 @@ }, { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { "Movement": { "starting_position": "F7", - "movement_actions_left": 3, + "movement_actions_left": 2, "cost": { "wood": 1, "ore": 1 @@ -793,7 +765,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3, + "movement_actions_left": 2, "cost": { "food": 1, "ore": 1 diff --git a/server/tests/test_games/movement_on_roads_to_city.json b/server/tests/test_games/movement_on_roads_to_city.json index c9ee33f0..812a56b5 100644 --- a/server/tests/test_games/movement_on_roads_to_city.json +++ b/server/tests/test_games/movement_on_roads_to_city.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, "players": [ @@ -419,9 +419,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -435,9 +432,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -475,9 +469,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -491,9 +482,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -531,9 +519,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": "Stop" }, @@ -563,12 +548,9 @@ }, { "Playing": "EndTurn" - }, - { - "Playing": "MoveUnits" } ], - "action_log_index": 23, + "action_log_index": 17, "log": [ "The game has started", "Age 1 has started", @@ -603,8 +585,8 @@ "Round 3/3", "Player2 used a move units action" ], - "undo_limit": 22, - "actions_left": 2, + "undo_limit": 16, + "actions_left": 0, "successful_cultural_influence": false, "round": 3, "age": 1, @@ -624,7 +606,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -646,7 +628,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -667,7 +649,7 @@ }, { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } } ] diff --git a/server/tests/test_games/movement_on_roads_to_city.outcome.json b/server/tests/test_games/movement_on_roads_to_city.outcome.json index f7a49b8e..5f16404c 100644 --- a/server/tests/test_games/movement_on_roads_to_city.outcome.json +++ b/server/tests/test_games/movement_on_roads_to_city.outcome.json @@ -1,12 +1,5 @@ { - "state": { - "Movement": { - "movement_actions_left": 2, - "moved_units": [ - 0 - ] - } - }, + "state": "Playing", "players": [ { "name": null, @@ -419,9 +412,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -435,9 +425,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -475,9 +462,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -491,9 +475,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -531,9 +512,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": "Stop" }, @@ -564,9 +542,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -578,7 +553,7 @@ } } ], - "action_log_index": 24, + "action_log_index": 18, "log": [ "The game has started", "Age 1 has started", @@ -614,8 +589,8 @@ "Player2 used a move units action", "\tPlayer2 marched 1 settler from F7 to D8 on roads" ], - "undo_limit": 22, - "actions_left": 2, + "undo_limit": 16, + "actions_left": 0, "successful_cultural_influence": false, "round": 3, "age": 1, @@ -635,7 +610,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -657,7 +632,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -678,13 +653,13 @@ }, { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { "Movement": { "starting_position": "F7", - "movement_actions_left": 3, + "movement_actions_left": 2, "cost": { "food": 1, "ore": 1 diff --git a/server/tests/test_games/remove_casualties_attacker.json b/server/tests/test_games/remove_casualties_attacker.json index 1d042437..2e066ca3 100644 --- a/server/tests/test_games/remove_casualties_attacker.json +++ b/server/tests/test_games/remove_casualties_attacker.json @@ -353,9 +353,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { diff --git a/server/tests/test_games/remove_casualties_attacker.outcome.json b/server/tests/test_games/remove_casualties_attacker.outcome.json index f9e8014d..5c50f031 100644 --- a/server/tests/test_games/remove_casualties_attacker.outcome.json +++ b/server/tests/test_games/remove_casualties_attacker.outcome.json @@ -264,9 +264,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -369,4 +366,4 @@ } } ] -} \ No newline at end of file +} diff --git a/server/tests/test_games/remove_casualties_defender.json b/server/tests/test_games/remove_casualties_defender.json index a6856467..d3f729a7 100644 --- a/server/tests/test_games/remove_casualties_defender.json +++ b/server/tests/test_games/remove_casualties_defender.json @@ -362,9 +362,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { diff --git a/server/tests/test_games/remove_casualties_defender.outcome.json b/server/tests/test_games/remove_casualties_defender.outcome.json index ed6c87a5..3a0ed4b1 100644 --- a/server/tests/test_games/remove_casualties_defender.outcome.json +++ b/server/tests/test_games/remove_casualties_defender.outcome.json @@ -275,9 +275,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -365,4 +362,4 @@ "Recruit": {} } ] -} \ No newline at end of file +} diff --git a/server/tests/test_games/retreat.json b/server/tests/test_games/retreat.json index 5ae0aff0..b6c6385c 100644 --- a/server/tests/test_games/retreat.json +++ b/server/tests/test_games/retreat.json @@ -356,9 +356,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { diff --git a/server/tests/test_games/retreat.outcome.json b/server/tests/test_games/retreat.outcome.json index 801fda93..e9ef251b 100644 --- a/server/tests/test_games/retreat.outcome.json +++ b/server/tests/test_games/retreat.outcome.json @@ -301,9 +301,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -391,4 +388,4 @@ "Recruit": {} } ] -} \ No newline at end of file +} diff --git a/server/tests/test_games/roads_unit_test.json b/server/tests/test_games/roads_unit_test.json index 1fb62050..be571f33 100644 --- a/server/tests/test_games/roads_unit_test.json +++ b/server/tests/test_games/roads_unit_test.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, "players": [ @@ -473,9 +473,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -489,9 +486,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -529,9 +523,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -545,9 +536,6 @@ { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -585,9 +573,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": "Stop" }, @@ -618,9 +603,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -685,15 +667,9 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": "Stop" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -723,9 +699,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -748,9 +721,6 @@ }, { "Movement": "Stop" - }, - { - "Playing": "MoveUnits" } ], "action_log_index": 45, @@ -841,7 +811,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -863,7 +833,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -884,13 +854,13 @@ }, { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { "Movement": { "starting_position": "F7", - "movement_actions_left": 3, + "movement_actions_left": 2, "cost": { "wood": 1, "ore": 1 @@ -907,7 +877,7 @@ }, { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -931,7 +901,7 @@ { "Movement": { "starting_position": "D7", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { diff --git a/server/tests/test_games/ship_disembark.json b/server/tests/test_games/ship_disembark.json index 42857695..b1e61793 100644 --- a/server/tests/test_games/ship_disembark.json +++ b/server/tests/test_games/ship_disembark.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, "players": [ @@ -343,12 +343,9 @@ } } } - }, - { - "Playing": "MoveUnits" } ], - "action_log_index": 2, + "action_log_index": 1, "log": [ "The game has started", "Age 1 has started", @@ -357,7 +354,7 @@ "Player1 used a move units action" ], "undo_limit": 1, - "actions_left": 1, + "actions_left": 0, "successful_cultural_influence": false, "round": 6, "age": 1, diff --git a/server/tests/test_games/ship_disembark.outcome.json b/server/tests/test_games/ship_disembark.outcome.json index 8df053d9..cbe88552 100644 --- a/server/tests/test_games/ship_disembark.outcome.json +++ b/server/tests/test_games/ship_disembark.outcome.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 2, + "movement_actions_left": 1, "moved_units": [ 1, 2 @@ -346,9 +346,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -361,7 +358,7 @@ } } ], - "action_log_index": 3, + "action_log_index": 2, "log": [ "The game has started", "Age 1 has started", @@ -371,7 +368,7 @@ "\tPlayer1 disembarked 1 cavalry and 1 elephant from C3 to B3" ], "undo_limit": 1, - "actions_left": 1, + "actions_left": 0, "successful_cultural_influence": false, "round": 6, "age": 1, @@ -428,7 +425,7 @@ { "Movement": { "starting_position": "C3", - "movement_actions_left": 3, + "movement_actions_left": 2, "disembarked_units": [ { "unit_id": 1, diff --git a/server/tests/test_games/ship_disembark_capture_empty_city.json b/server/tests/test_games/ship_disembark_capture_empty_city.json index e069768e..2a62ed7d 100644 --- a/server/tests/test_games/ship_disembark_capture_empty_city.json +++ b/server/tests/test_games/ship_disembark_capture_empty_city.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, "players": [ @@ -399,9 +399,6 @@ } } } - }, - { - "Playing": "MoveUnits" } ], "action_log_index": 2, diff --git a/server/tests/test_games/ship_disembark_capture_empty_city.outcome.json b/server/tests/test_games/ship_disembark_capture_empty_city.outcome.json index 6dbe5628..245f9464 100644 --- a/server/tests/test_games/ship_disembark_capture_empty_city.outcome.json +++ b/server/tests/test_games/ship_disembark_capture_empty_city.outcome.json @@ -2,7 +2,7 @@ "state": { "PlaceSettler": { "player_index": 1, - "movement_actions_left": 2, + "movement_actions_left": 1, "moved_units": [ 1, 2 @@ -353,9 +353,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -435,7 +432,7 @@ { "Movement": { "starting_position": "C3", - "movement_actions_left": 3, + "movement_actions_left": 2, "disembarked_units": [ { "unit_id": 1, diff --git a/server/tests/test_games/ship_embark.json b/server/tests/test_games/ship_embark.json index cbf7a41b..80b1cbf7 100644 --- a/server/tests/test_games/ship_embark.json +++ b/server/tests/test_games/ship_embark.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, "players": [ @@ -344,12 +344,8 @@ }, "starting_player_index": 0, "current_player_index": 0, - "action_log": [ - { - "Playing": "MoveUnits" - } - ], - "action_log_index": 1, + "action_log": [], + "action_log_index": 0, "log": [ "The game has started", "Age 1 has started", @@ -358,7 +354,7 @@ "Player1 used a move units action" ], "undo_limit": 0, - "actions_left": 2, + "actions_left": 0, "successful_cultural_influence": false, "round": 6, "age": 1, diff --git a/server/tests/test_games/ship_embark.outcome.json b/server/tests/test_games/ship_embark.outcome.json index 92dff5d8..15bea3fd 100644 --- a/server/tests/test_games/ship_embark.outcome.json +++ b/server/tests/test_games/ship_embark.outcome.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 2, + "movement_actions_left": 1, "moved_units": [ 3, 4 @@ -357,9 +357,6 @@ "starting_player_index": 0, "current_player_index": 0, "action_log": [ - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -373,7 +370,7 @@ } } ], - "action_log_index": 2, + "action_log_index": 1, "log": [ "The game has started", "Age 1 has started", @@ -383,7 +380,7 @@ "\tPlayer1 embarked 2 settlers from B3 to C3" ], "undo_limit": 0, - "actions_left": 2, + "actions_left": 0, "successful_cultural_influence": false, "round": 6, "age": 1, @@ -446,7 +443,7 @@ { "Movement": { "starting_position": "B3", - "movement_actions_left": 3 + "movement_actions_left": 2 } } ] diff --git a/server/tests/test_games/ship_embark_continue.json b/server/tests/test_games/ship_embark_continue.json index 92dff5d8..090b7b05 100644 --- a/server/tests/test_games/ship_embark_continue.json +++ b/server/tests/test_games/ship_embark_continue.json @@ -357,9 +357,6 @@ "starting_player_index": 0, "current_player_index": 0, "action_log": [ - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -373,7 +370,7 @@ } } ], - "action_log_index": 2, + "action_log_index": 1, "log": [ "The game has started", "Age 1 has started", @@ -446,8 +443,8 @@ { "Movement": { "starting_position": "B3", - "movement_actions_left": 3 + "movement_actions_left": 2 } } ] -} \ No newline at end of file +} diff --git a/server/tests/test_games/ship_embark_continue.outcome.json b/server/tests/test_games/ship_embark_continue.outcome.json index d6314a9c..72449d92 100644 --- a/server/tests/test_games/ship_embark_continue.outcome.json +++ b/server/tests/test_games/ship_embark_continue.outcome.json @@ -361,9 +361,6 @@ "starting_player_index": 0, "current_player_index": 0, "action_log": [ - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -389,7 +386,7 @@ } } ], - "action_log_index": 3, + "action_log_index": 2, "log": [ "The game has started", "Age 1 has started", @@ -463,7 +460,7 @@ { "Movement": { "starting_position": "B3", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -483,4 +480,4 @@ } } ] -} \ No newline at end of file +} diff --git a/server/tests/test_games/ship_explore.json b/server/tests/test_games/ship_explore.json index 2b277d1a..47e17d8a 100644 --- a/server/tests/test_games/ship_explore.json +++ b/server/tests/test_games/ship_explore.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, "players": [ @@ -536,9 +536,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -588,9 +585,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -656,9 +650,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -724,9 +715,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -786,9 +774,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -1078,9 +1063,6 @@ }, { "Playing": "EndTurn" - }, - { - "Playing": "MoveUnits" } ], "action_log_index": 50, @@ -1181,7 +1163,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1195,7 +1177,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1209,7 +1191,7 @@ { "Movement": { "starting_position": "E8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { diff --git a/server/tests/test_games/ship_explore.outcome.json b/server/tests/test_games/ship_explore.outcome.json index 6b5d02f3..ea1822df 100644 --- a/server/tests/test_games/ship_explore.outcome.json +++ b/server/tests/test_games/ship_explore.outcome.json @@ -1,12 +1,5 @@ { - "state": { - "Movement": { - "movement_actions_left": 2, - "moved_units": [ - 1 - ] - } - }, + "state": "Playing", "players": [ { "name": null, @@ -446,9 +439,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -486,9 +476,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -536,9 +523,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -586,9 +570,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -636,9 +617,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -855,9 +833,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -968,7 +943,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -982,7 +957,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -996,7 +971,7 @@ { "Movement": { "starting_position": "E8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { diff --git a/server/tests/test_games/ship_explore_move_not_possible.json b/server/tests/test_games/ship_explore_move_not_possible.json index 5ab027a1..c260479a 100644 --- a/server/tests/test_games/ship_explore_move_not_possible.json +++ b/server/tests/test_games/ship_explore_move_not_possible.json @@ -487,9 +487,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -527,9 +524,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -577,9 +571,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -627,9 +618,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -677,9 +665,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -896,9 +881,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -910,7 +892,7 @@ } } ], - "action_log_index": 51, + "action_log_index": 45, "log": [ "The game has started", "Age 1 has started", @@ -988,7 +970,7 @@ "Player2 used a move units action", "\tPlayer2 sailed 1 ship from D5 to E5" ], - "undo_limit": 51, + "undo_limit": 45, "actions_left": 2, "successful_cultural_influence": false, "round": 3, @@ -1009,7 +991,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1023,7 +1005,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1037,7 +1019,7 @@ { "Movement": { "starting_position": "E8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1144,4 +1126,4 @@ "Recruit": {} } ] -} \ No newline at end of file +} diff --git a/server/tests/test_games/ship_explore_move_not_possible.outcome.json b/server/tests/test_games/ship_explore_move_not_possible.outcome.json index 8141b158..c3a97f2c 100644 --- a/server/tests/test_games/ship_explore_move_not_possible.outcome.json +++ b/server/tests/test_games/ship_explore_move_not_possible.outcome.json @@ -1,12 +1,5 @@ { - "state": { - "Movement": { - "movement_actions_left": 2, - "moved_units": [ - 1 - ] - } - }, + "state": "Playing", "players": [ { "name": null, @@ -446,9 +439,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -486,9 +476,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -536,9 +523,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -586,9 +570,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -636,9 +617,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -855,9 +833,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -872,7 +847,7 @@ "ExploreResolution": 3 } ], - "action_log_index": 52, + "action_log_index": 46, "log": [ "The game has started", "Age 1 has started", @@ -951,7 +926,7 @@ "\tPlayer2 sailed 1 ship from D5 to E5", "Player2 chose the orientation of the newly explored tiles. Explored tiles E5=Forest, F4=Fertile, F5=Fertile, G5=Mountain. Ship can't move to the explored tile" ], - "undo_limit": 51, + "undo_limit": 45, "actions_left": 2, "successful_cultural_influence": false, "round": 3, @@ -972,7 +947,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -986,7 +961,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1000,7 +975,7 @@ { "Movement": { "starting_position": "E8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { diff --git a/server/tests/test_games/ship_explore_teleport.json b/server/tests/test_games/ship_explore_teleport.json index 95d08399..eae4a627 100644 --- a/server/tests/test_games/ship_explore_teleport.json +++ b/server/tests/test_games/ship_explore_teleport.json @@ -532,9 +532,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -584,9 +581,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -652,9 +646,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -720,9 +711,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -782,9 +770,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -1075,9 +1060,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -1188,7 +1170,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1202,7 +1184,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1216,7 +1198,7 @@ { "Movement": { "starting_position": "E8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { diff --git a/server/tests/test_games/ship_explore_teleport.outcome.json b/server/tests/test_games/ship_explore_teleport.outcome.json index b21b1d4f..9e527bff 100644 --- a/server/tests/test_games/ship_explore_teleport.outcome.json +++ b/server/tests/test_games/ship_explore_teleport.outcome.json @@ -1,12 +1,5 @@ { - "state": { - "Movement": { - "movement_actions_left": 2, - "moved_units": [ - 1 - ] - } - }, + "state": "Playing", "players": [ { "name": null, @@ -432,9 +425,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -472,9 +462,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -522,9 +509,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -572,9 +556,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -622,9 +603,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -841,9 +819,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -965,7 +940,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -979,7 +954,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -993,7 +968,7 @@ { "Movement": { "starting_position": "E8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { diff --git a/server/tests/test_games/ship_navigate.json b/server/tests/test_games/ship_navigate.json index fbf70198..2ebfb99d 100644 --- a/server/tests/test_games/ship_navigate.json +++ b/server/tests/test_games/ship_navigate.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, "players": [ @@ -416,9 +416,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -456,9 +453,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -506,9 +500,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -556,9 +547,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -606,9 +594,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -825,9 +810,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -883,12 +865,9 @@ } } } - }, - { - "Playing": "MoveUnits" } ], - "action_log_index": 58, + "action_log_index": 51, "log": [ "The game has started", "Age 1 has started", @@ -973,7 +952,7 @@ "Player2 paid 2 food to get the Navigation advance", "Player2 used a move units action" ], - "undo_limit": 55, + "undo_limit": 48, "actions_left": 0, "successful_cultural_influence": false, "round": 3, @@ -994,7 +973,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1008,7 +987,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1022,7 +1001,7 @@ { "Movement": { "starting_position": "E8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1195,4 +1174,4 @@ } } ] -} \ No newline at end of file +} diff --git a/server/tests/test_games/ship_navigate.outcome.json b/server/tests/test_games/ship_navigate.outcome.json index 93cc787f..032b21ca 100644 --- a/server/tests/test_games/ship_navigate.outcome.json +++ b/server/tests/test_games/ship_navigate.outcome.json @@ -1,12 +1,5 @@ { - "state": { - "Movement": { - "movement_actions_left": 2, - "moved_units": [ - 1 - ] - } - }, + "state": "Playing", "players": [ { "name": null, @@ -419,9 +412,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -459,9 +449,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -509,9 +496,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -559,9 +543,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -609,9 +590,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -828,9 +806,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -887,9 +862,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -901,7 +873,7 @@ } } ], - "action_log_index": 59, + "action_log_index": 52, "log": [ "The game has started", "Age 1 has started", @@ -987,7 +959,7 @@ "Player2 used a move units action", "\tPlayer2 sailed 1 ship from B5 to A7" ], - "undo_limit": 55, + "undo_limit": 48, "actions_left": 0, "successful_cultural_influence": false, "round": 3, @@ -1008,7 +980,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1022,7 +994,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1036,7 +1008,7 @@ { "Movement": { "starting_position": "E8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1211,7 +1183,7 @@ { "Movement": { "starting_position": "B5", - "movement_actions_left": 3 + "movement_actions_left": 2 } } ] diff --git a/server/tests/test_games/ship_navigate_explore_move.json b/server/tests/test_games/ship_navigate_explore_move.json index 32334c2e..9fcc0c70 100644 --- a/server/tests/test_games/ship_navigate_explore_move.json +++ b/server/tests/test_games/ship_navigate_explore_move.json @@ -505,9 +505,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -557,9 +554,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -625,9 +619,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -693,9 +684,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -755,9 +743,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -1048,9 +1033,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -1113,9 +1095,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -1234,7 +1213,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1248,7 +1227,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1262,7 +1241,7 @@ { "Movement": { "starting_position": "E8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1441,7 +1420,7 @@ { "Movement": { "starting_position": "B5", - "movement_actions_left": 3 + "movement_actions_left": 2 } } ] diff --git a/server/tests/test_games/ship_navigate_explore_move.outcome.json b/server/tests/test_games/ship_navigate_explore_move.outcome.json index d451ebfa..1faed748 100644 --- a/server/tests/test_games/ship_navigate_explore_move.outcome.json +++ b/server/tests/test_games/ship_navigate_explore_move.outcome.json @@ -1,12 +1,5 @@ { - "state": { - "Movement": { - "movement_actions_left": 2, - "moved_units": [ - 1 - ] - } - }, + "state": "Playing", "players": [ { "name": null, @@ -405,9 +398,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -445,9 +435,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -495,9 +482,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -545,9 +529,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -595,9 +576,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -814,9 +792,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -873,9 +848,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -1005,7 +977,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1019,7 +991,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1033,7 +1005,7 @@ { "Movement": { "starting_position": "E8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1208,7 +1180,7 @@ { "Movement": { "starting_position": "B5", - "movement_actions_left": 3 + "movement_actions_left": 2 } } ] diff --git a/server/tests/test_games/ship_navigate_explore_not_move.json b/server/tests/test_games/ship_navigate_explore_not_move.json index 1f489c6c..ea309ed4 100644 --- a/server/tests/test_games/ship_navigate_explore_not_move.json +++ b/server/tests/test_games/ship_navigate_explore_not_move.json @@ -505,9 +505,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -557,9 +554,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -625,9 +619,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -693,9 +684,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -755,9 +743,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -1048,9 +1033,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -1113,9 +1095,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -1234,7 +1213,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1248,7 +1227,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1262,7 +1241,7 @@ { "Movement": { "starting_position": "E8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1441,7 +1420,7 @@ { "Movement": { "starting_position": "B5", - "movement_actions_left": 3 + "movement_actions_left": 2 } } ] diff --git a/server/tests/test_games/ship_navigate_explore_not_move.outcome.json b/server/tests/test_games/ship_navigate_explore_not_move.outcome.json index 6cec8de5..cd4b247f 100644 --- a/server/tests/test_games/ship_navigate_explore_not_move.outcome.json +++ b/server/tests/test_games/ship_navigate_explore_not_move.outcome.json @@ -439,9 +439,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -479,9 +476,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -529,9 +523,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -579,9 +570,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -629,9 +617,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -848,9 +833,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -907,9 +889,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -1039,7 +1018,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1053,7 +1032,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1067,7 +1046,7 @@ { "Movement": { "starting_position": "E8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1242,8 +1221,8 @@ { "Movement": { "starting_position": "B5", - "movement_actions_left": 3 + "movement_actions_left": 2 } } ] -} \ No newline at end of file +} diff --git a/server/tests/test_games/ship_navigation_unit_test.json b/server/tests/test_games/ship_navigation_unit_test.json index 57b290a0..d99e7cf4 100644 --- a/server/tests/test_games/ship_navigation_unit_test.json +++ b/server/tests/test_games/ship_navigation_unit_test.json @@ -475,9 +475,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -527,9 +524,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -595,9 +589,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -663,9 +654,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -725,9 +713,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -1018,9 +1003,6 @@ { "Playing": "EndTurn" }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -1083,9 +1065,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -1314,7 +1293,7 @@ { "Movement": { "starting_position": "D8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1328,7 +1307,7 @@ { "Movement": { "starting_position": "D1", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1342,7 +1321,7 @@ { "Movement": { "starting_position": "E8", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1521,7 +1500,7 @@ { "Movement": { "starting_position": "B5", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -1653,4 +1632,4 @@ } } ] -} \ No newline at end of file +} diff --git a/server/tests/test_games/ship_transport.json b/server/tests/test_games/ship_transport.json index 42857695..b1e61793 100644 --- a/server/tests/test_games/ship_transport.json +++ b/server/tests/test_games/ship_transport.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 3 + "movement_actions_left": 2 } }, "players": [ @@ -343,12 +343,9 @@ } } } - }, - { - "Playing": "MoveUnits" } ], - "action_log_index": 2, + "action_log_index": 1, "log": [ "The game has started", "Age 1 has started", @@ -357,7 +354,7 @@ "Player1 used a move units action" ], "undo_limit": 1, - "actions_left": 1, + "actions_left": 0, "successful_cultural_influence": false, "round": 6, "age": 1, diff --git a/server/tests/test_games/ship_transport.outcome.json b/server/tests/test_games/ship_transport.outcome.json index a54c0a04..7bbb88f4 100644 --- a/server/tests/test_games/ship_transport.outcome.json +++ b/server/tests/test_games/ship_transport.outcome.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 2, + "movement_actions_left": 1, "moved_units": [ 7 ], @@ -354,9 +354,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -368,7 +365,7 @@ } } ], - "action_log_index": 3, + "action_log_index": 2, "log": [ "The game has started", "Age 1 has started", @@ -378,7 +375,7 @@ "\tPlayer1 sailed 1 ship from C3 to D2" ], "undo_limit": 1, - "actions_left": 1, + "actions_left": 0, "successful_cultural_influence": false, "round": 6, "age": 1, @@ -435,7 +432,7 @@ { "Movement": { "starting_position": "C3", - "movement_actions_left": 3 + "movement_actions_left": 2 } } ] diff --git a/server/tests/test_games/ship_transport_same_sea.json b/server/tests/test_games/ship_transport_same_sea.json index a54c0a04..44a26716 100644 --- a/server/tests/test_games/ship_transport_same_sea.json +++ b/server/tests/test_games/ship_transport_same_sea.json @@ -354,9 +354,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -368,7 +365,7 @@ } } ], - "action_log_index": 3, + "action_log_index": 2, "log": [ "The game has started", "Age 1 has started", @@ -435,8 +432,8 @@ { "Movement": { "starting_position": "C3", - "movement_actions_left": 3 + "movement_actions_left": 2 } } ] -} \ No newline at end of file +} diff --git a/server/tests/test_games/ship_transport_same_sea.outcome.json b/server/tests/test_games/ship_transport_same_sea.outcome.json index 1bb7a794..2dd20568 100644 --- a/server/tests/test_games/ship_transport_same_sea.outcome.json +++ b/server/tests/test_games/ship_transport_same_sea.outcome.json @@ -354,9 +354,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { @@ -378,7 +375,7 @@ } } ], - "action_log_index": 4, + "action_log_index": 3, "log": [ "The game has started", "Age 1 has started", @@ -446,7 +443,7 @@ { "Movement": { "starting_position": "C3", - "movement_actions_left": 3 + "movement_actions_left": 2 } }, { @@ -466,4 +463,4 @@ } } ] -} \ No newline at end of file +} diff --git a/server/tests/test_games/until_remove_casualties_attacker.json b/server/tests/test_games/until_remove_casualties_attacker.json index 2bdee839..5c976955 100644 --- a/server/tests/test_games/until_remove_casualties_attacker.json +++ b/server/tests/test_games/until_remove_casualties_attacker.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 3} + "movement_actions_left": 2} }, "players": [ { @@ -337,9 +337,6 @@ } } } - }, - { - "Playing": "MoveUnits" } ], "action_log_index": 2, diff --git a/server/tests/test_games/until_remove_casualties_attacker.outcome.json b/server/tests/test_games/until_remove_casualties_attacker.outcome.json index badeccdb..6f22d56e 100644 --- a/server/tests/test_games/until_remove_casualties_attacker.outcome.json +++ b/server/tests/test_games/until_remove_casualties_attacker.outcome.json @@ -3,7 +3,7 @@ "Combat": { "initiation": { "Movement": { - "movement_actions_left": 2, + "movement_actions_left": 1, "moved_units": [ 0, 1, @@ -300,9 +300,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": { diff --git a/server/tests/test_games/until_remove_casualties_defender.json b/server/tests/test_games/until_remove_casualties_defender.json index 5e5dc425..a50df746 100644 --- a/server/tests/test_games/until_remove_casualties_defender.json +++ b/server/tests/test_games/until_remove_casualties_defender.json @@ -1,7 +1,7 @@ { "state": { "Movement": { - "movement_actions_left": 3} + "movement_actions_left": 2} }, "players": [ { @@ -337,9 +337,6 @@ } } } - }, - { - "Playing": "MoveUnits" } ], "action_log_index": 2, diff --git a/server/tests/test_games/until_remove_casualties_defender.outcome.json b/server/tests/test_games/until_remove_casualties_defender.outcome.json index 00fddbe0..2f11625f 100644 --- a/server/tests/test_games/until_remove_casualties_defender.outcome.json +++ b/server/tests/test_games/until_remove_casualties_defender.outcome.json @@ -3,7 +3,7 @@ "Combat": { "initiation": { "Movement": { - "movement_actions_left": 2, + "movement_actions_left": 1, "moved_units": [ 0 ] @@ -307,9 +307,6 @@ } } }, - { - "Playing": "MoveUnits" - }, { "Movement": { "Move": {