using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; namespace DominionBase { public class UsageDataProvider { public static IEnumerable GetColonyPlatinumUsageValues(Type enumType) { var allValues = Enum.GetValues(enumType); return allValues.OfType(); } public static IEnumerable GetShelterUsageValues(Type enumType) { var allValues = Enum.GetValues(enumType); return allValues.OfType(); } public static IEnumerable GetLandscapeCardUsageValues(Type enumType) { var allValues = Enum.GetValues(enumType); return allValues.OfType(); } public static IEnumerable GetEditionUsageValues(Type enumType) { var allValues = Enum.GetValues(enumType); return allValues.OfType().Where(e => e != EditionUsage.AllowDuplicates); } } public enum ColonyPlatinumUsage { [Description("First Kingdom card selected (official rule)")] FirstKingdomCard, [Description("Percentage chance based on number of Prosperity cards selected")] PercentageChance, [Description("50% chance")] FiftyPercentChance, [Description("50% chance if at least 1 Prosperity card is selected")] FiftyPercentChanceWithProsperity, [Description("Always")] Always, [Description("Always if at least 1 Prosperity card is selected")] AlwaysWithProsperity, [Description("Never")] Never } public enum ColonyPlatinumSelected { Yes, No, Unknown } public enum ShelterUsage { [Description("Last Kingdom card selected (official rule)")] LastKingdomCard, [Description("Percentage chance based on number of Dark Ages cards selected")] PercentageChance, [Description("50% chance")] FiftyPercentChance, [Description("50% chance if at least 1 Dark Ages card is selected")] FiftyPercentChanceWithDarkAges, [Description("Always")] Always, [Description("Always if at least 1 Dark Ages card is selected")] AlwaysWithDarkAges, [Description("Never")] Never } public enum ShelterSelected { Yes, No, Unknown } public enum LandscapeCardUsage { [Description("Percentage chance (official rule)")] Percentage, [Description("Percentage chance if at least one Adventures or Empires card is selected")] PercentageIfAdventuresEmpiresRenaissance, [Description("Percentage chance of used sets only")] PercentageFromUsedSets, [Description("Percentage chance of used sets only if at least one Adventures, Empires, or Renaissance card is selected")] PercentageIfAdventuresEmpiresRenaissanceFromUsedSets, [Description("Always 1")] AlwaysOne, [Description("Always 2")] AlwaysTwo, [Description("Always 3")] AlwaysThree, [Description("Always 1 if at least one Adventures, Empires, or Renaissance card is selected")] AlwaysOneIfAdventuresEmpiresRenaissance, [Description("Always 2 if at least one Adventures, Empires, or Renaissance card is selected")] AlwaysTwoIfAdventuresEmpiresRenaissance, [Description("Always 3 if at least one Adventures, Empires, or Renaissance card is selected")] AlwaysThreeIfAdventuresEmpiresRenaissance, [Description("Never")] Never } public enum LandscapeCardSelected { None, One, Two, Three, Unknown } public enum EditionUsage { [Description("Allow duplicates (this shouldn't be selectable)")] AllowDuplicates, [Description("Only use 1st edition cards (no 2nd edition at all)")] FirstOnly, [Description("Only use 2nd edition cards (no 1st edition at all)")] SecondOnly, [Description("Use 1st and 2nd editions, but use 1st edition cards where there's overlap")] FirstPriority, [Description("Use 1st and 2nd editions, but use 2nd edition cards where there's overlap")] SecondPriority, //[Description("Use all editions, but prioritize 2019 Errata wording over 2nd Edition, over 1st Edition")] //Errata2019Priority, } public enum AISpeed { Fastest, Fast, Medium, Slow, [Description("Very Slow")] VerySlow } [Serializable] public class GameSettings { public bool IdenticalStartingHands { get; set; } = false; public Cards.ConstraintCollection Constraints { get; } = new Cards.ConstraintCollection(10); public Cards.Preset Preset { get; set; } = null; public ColonyPlatinumUsage ColonyPlatinumUsage { get; set; } = ColonyPlatinumUsage.FirstKingdomCard; public ColonyPlatinumSelected ColonyPlatinumSelected { get; internal set; } = ColonyPlatinumSelected.Unknown; public ShelterUsage ShelterUsage { get; set; } = ShelterUsage.LastKingdomCard; public ShelterSelected ShelterSelected { get; internal set; } = ShelterSelected.Unknown; public LandscapeCardUsage LandscapeCardUsage { get; set; } = LandscapeCardUsage.Percentage; public EditionUsage EditionUsage { get; set; } = EditionUsage.SecondPriority; public Cards.ConstraintCollection LandscapeCardConstraints { get; } = new Cards.ConstraintCollection(3); public Cards.CardsSettingsCollection CardSettings { get; } = new Cards.CardsSettingsCollection(); public bool RandomAI_Unique { get; set; } = false; public List RandomAI_AllowedAIs { get; } = new List(); public AISpeed AISpeed { get; set; } = AISpeed.Medium; } }