/// <summary> /// Adds something to map settings. /// </summary> /// <remarks> /// Token in parameter must be Setup token. /// </remarks> /// <param name="commandToken">Token.</param> public void SetupMap(ISetupMapToken commandToken) { if (HasStarted) { throw new ArgumentException($"The game has already started, you cannot setup map."); } switch (commandToken.CommandTokenType) { case CommandTokenType.SetupSuperRegions: setupSuperRegionsToken = (SetupSuperRegionsToken)commandToken; break; case CommandTokenType.SetupRegions: setupRegionsToken = (SetupRegionsToken)commandToken; break; case CommandTokenType.SetupNeighbours: setupNeighboursToken = (SetupNeighboursToken)commandToken; break; case CommandTokenType.SetupWastelands: setupWastelandsToken = (SetupWastelandsToken)commandToken; break; default: throw new ArgumentException($"When calling {nameof(SetupMap)}, its argument {nameof(commandToken)} must be of Setup type."); } }
private ICommandToken Execute(ISetupMapToken token) { mapController.SetupMap(token); return(null); }