public static void ShowResult(WarState finalState) { if (!finalState.IsAbsoluteVictory) { Console.WriteLine(); Console.WriteLine("FROM THE RESULTS OF BOTH OF YOUR ATTACKS,"); } switch (finalState.FinalOutcome) { case WarResult.ComputerVictory: Console.WriteLine("YOU LOST-I CONQUERED YOUR COUNTRY. IT SERVES YOU"); Console.WriteLine("RIGHT FOR PLAYING THIS STUPID GAME!!!"); break; case WarResult.PlayerVictory: Console.WriteLine("YOU WON, OH! SHUCKS!!!!"); break; case WarResult.PeaceTreaty: Console.WriteLine("THE TREATY OF PARIS CONCLUDED THAT WE TAKE OUR"); Console.WriteLine("RESPECTIVE COUNTRIES AND LIVE IN PEACE."); break; } }
/// <summary> /// Gets the military branch for the user's next attack. /// </summary> public static MilitaryBranch GetAttackBranch(WarState state, bool isFirstTurn) { if (isFirstTurn) { View.PromptFirstAttackBranch(); } else { View.PromptNextAttackBranch(state.ComputerForces, state.PlayerForces); } // If the user entered an invalid branch number in the original // game, the code fell through to the army case. We'll preserve // that behaviour here. return(Console.ReadLine() switch { "2" => MilitaryBranch.Navy, "3" => MilitaryBranch.AirForce, _ => MilitaryBranch.Army });