private static VariantOffer CheckNeedBuild(Context context, PlayerInfoCM player, AIOptions options, int restOfGold) { VariantOfferPackage package = new VariantOfferPackage(); package.Add(AuctionCommon.CheckNeedBuild(context, player, options, Build.Poseidon, restOfGold)); package.CheckAll(options); return package.GetAvg(); }
private static VariantOffer CheckNeedBuild(Context context, PlayerInfoCM player, AIOptions options, int restOfGold) { VariantOfferPackage package = new VariantOfferPackage(); package.Add(AuctionCommon.CheckNeedBuild(context, player, options, Build.Zeus, restOfGold)); if (restOfGold >= Cyclades.Constants.buildingCost) package.Add(new VariantOffer(Cyclades.Constants.buildingCost, options.coefficients.TempleVPT * options.turnsToEnd)); package.CheckAll(options); return package.GetAvg(); }
public AIVariant Choose(List<AIVariant> variants, AIOptions options) { VariantOfferPackage packadge = new VariantOfferPackage(); for (int i = 0; i < variants.Count; ++i) { if (variants[i] != null && variants[i].offer != null) packadge.Add(variants[i].offer); } packadge.CheckAll(options); VariantOffer theBestOffer = packadge.GetTheBestOne(options); if (theBestOffer == null) throw new Exception("AI: No variants to choose"); return variants.Where(e => e.offer == theBestOffer).First(); }
public static void AddVariant(AIVariantPackage variants, Context context, PlayerInfoCM player, AIOptions options, int minBetGold) { AIAuctionVariant variant = new AIAuctionVariant(God.Poseidon, minBetGold + player.Priests); int restOfGold = player.Gold - minBetGold; VariantOfferPackage offers = new VariantOfferPackage(); offers.Add(CheckNeedBuild(context, player, options, restOfGold)); offers.Add(CheckBuildAndMoveNavy(context, player, options, restOfGold)); offers.CheckAll(options); VariantOffer offer = offers.GetTheBestSumWithCostLimit(restOfGold); offer.cost += minBetGold; variant.offer = offer; variants.AddVariant(variant); }
private static VariantOffer CheckPhilosopher(Context context, PlayerInfoCM player, AIOptions options, int restOfGold) { VariantOfferPackage package = new VariantOfferPackage(); for (int i = 0; i < Cyclades.Constants.philosopherPrices.Count; ++i) { int cost = Cyclades.Constants.philosopherPrices[i]; if (cost > restOfGold) break; package.Add(new VariantOffer(cost, options.coefficients.PhilosopherVP)); restOfGold -= cost; } package.CheckAll(options); return package.GetSum(); }