public Matchup GenerateMatchup(GenerationSettings settings) { var random = new Random(); DowMap map = settings.Maps[random.Next(settings.Maps.Count)]; var info = new GameInfo() { Options = new GameOptions() { Difficulty = (GameDifficulty)RandomOption(settings.GameDifficultyTickets, random), Speed = (GameSpeed)RandomOption(settings.GameSpeedTickets, random), ResourceRate = (GameResourceRate)RandomOption(settings.ResourceRateTickets, random), StartingResources = (GameStartResource)RandomOption(settings.StartResourceTickets, random) } }; info.Rules.Add(settings.Rules[random.Next(settings.Rules.Count)]); var matchup = new Matchup(map, info); if (settings.Teams != null) { // TODO generate the team compositions } return(matchup); }
private int MapSort(DowMap a, DowMap b) { return(a.Players != b.Players ? a.Players - b.Players : a.Size != b.Size ? a.Size - b.Size : string.Compare(a.Name, b.Name)); }
public Matchup(DowMap map, GameInfo info) { Map = map; GameInfo = info; }
public string GetMapImagePath(DowMap map) { string root = map.Mod.IsVanilla ? filePathProvider.AppDataLocation : filePathProvider.SoulstormLocation; return(Path.Combine(root, map.Mod.ModFolder, "data", "scenarios", "mp", map.Image)); }