private Func <Task>[] GetMatchPlan(ISoldatClientCommands client, string currentMapName) { return(new Func <Task>[] { Do(() => client.SetMap(currentMapName)), Wait(TimeSpan.FromSeconds(10)), Do(() => client.Say("Warm-up session - check you server and team!")), Wait(_warmupLength - TimeSpan.FromSeconds(30)), Do(() => client.Say("Warm-up session ends in 30 seconds!")), Wait(TimeSpan.FromSeconds(20)), Countdown(client, 10), Do(() => client.SetMap(currentMapName)), Wait(TimeSpan.FromSeconds(10)), Do(() => client.Say("Tournament match, Round 1 - This is not a drill!")), Wait(_matchLength), Do(() => client.SetMap(currentMapName)), Wait(TimeSpan.FromSeconds(3)), Do(() => client.SwapTeams()), Wait(TimeSpan.FromSeconds(2)), Do(() => client.Say("Tournament match, Round 2, Teams Swapped - This is not a drill!")), Wait(_matchLength), }); }
private Func <Task> Countdown(ISoldatClientCommands client, int n) { return(async() => { for (int i = n; i > 0; --i) { client.Say($"{i}..."); await Task.Delay(TimeSpan.FromSeconds(1)); } }); }