예제 #1
0
 void IActionEstimator.newStreet(BotGameState gameState)
 {
     if (gameState.getStreet() == Street.Flop)
     {
         DecisionMakingDll.GameContext_NewFlop(_dmContext, gameState.getBoard(), gameState.getHeroHoleCards());
     }
 }
        public void UpdateBaseEconomyGameStateForMove(BotMoveState movesState, BotGameState botGameStateService, int supportedCaravans)
        {
            var onRouteCaravans = 0;

            for (var tradecaravan = 0; tradecaravan < supportedCaravans; tradecaravan++)
            {
                var movingCaravan = movesState.TradeCaravansAvailable[tradecaravan];
                if (movingCaravan.CaravanDestinationType == CaravanDestinationType.CityState)
                {
                    if (!botGameStateService.CityStateDiplomacyCardsHeld.Contains(movingCaravan.CaravanCityStateDestination))
                    {
                        // TODO: add city state diplomacy card to city state diplomancy cards collection (if not visited)
                        botGameStateService.CityStateDiplomacyCardsHeld.Add(movingCaravan.CaravanCityStateDestination);
                    }
                }
                else if (movingCaravan.CaravanDestinationType == CaravanDestinationType.RivalCity)
                {
                    if (!botGameStateService.VisitedPlayerColors.Contains(movingCaravan.CaravanRivalCityColorDestination))
                    {
                        // TODO: add players diplomacy card (in order stated in rules) to rival diplomacy cards collection
                        botGameStateService.VisitedPlayerColors.Add(movingCaravan.CaravanRivalCityColorDestination);
                    }
                }
                else
                {
                    onRouteCaravans += 1;
                }
            }

            botGameStateService.SupportedCaravanCount = movesState.SupportedCaravanCount;
            botGameStateService.CaravansOnRouteCount  = onRouteCaravans;
            botGameStateService.TradeTokens           = new Dictionary <FocusType, int>(movesState.TradeTokensAvailable);
        }
예제 #3
0
        private string BuildMoveSummary(BotGameState gameState)
        {
            var summary = "To summarise my move I did the following;\n";

            summary += $"I asked you to remove all barbarians adjacent to my territory from the board;\n";
            return(_economyResolverUtility.BuildGeneralisedEconomyMoveSummary(summary, gameState, _moveState));
        }
예제 #4
0
        private EstimatedAD getPlayerToActAD(Player playerToAct, BotGameState gameState)
        {
            if (gameState.getStreet() == Street.PreFlop)
            {
                var preFlopParams = new PreFlopParams(
                    gameState.getTableType(),
                    playerToAct.PreFlopPosition,
                    gameState.getNumCallers(),
                    gameState.getNumBets(),
                    gameState.numActivePlayers(),
                    playerToAct.LastAction,
                    gameState.isPlayerInPosition(gameState.getPlayerToActInd()));

                return(playerToAct.GetAD(preFlopParams));
            }
            else
            {
                var        round      = playerToAct.Round();
                ActionType prevAction = (round == 0) ? playerToAct.PrevStreetAction : playerToAct.LastAction;

                var postFlopParams = new PostFlopParams(
                    gameState.getTableType(),
                    gameState.getStreet(),
                    round,
                    prevAction,
                    gameState.getNumBets(),
                    gameState.isPlayerInPosition(gameState.getPlayerToActInd()),
                    gameState.numActivePlayers());

                return(playerToAct.GetAD(postFlopParams));
            }
        }
 public override string UpdateGameStateForMove(BotGameState botGameStateService)
 {
     _economyResolverUtility.UpdateBaseEconomyGameStateForMove(_moveState, botGameStateService, SupportedCaravans);
     botGameStateService.ControlledNaturalResources += BaseFreeResources;
     _currentStep = -1;
     return(BuildMoveSummary(botGameStateService));
 }
        private string BuildMoveSummary(BotGameState gameState)
        {
            var summary = "To summarise my move I did the following;\n";

            summary += $"I updated my game state to show that I recieved {BaseFreeResources} natural resource(s) which I may use for future construction projects\n";
            return(_economyResolverUtility.BuildGeneralisedEconomyMoveSummary(summary, gameState, _moveState));
        }
예제 #7
0
 private void WriteConsoleGameStart(BotGameState gameState)
 {
     System.Console.WriteLine("#############################");
     System.Console.WriteLine($"Leader Selected: {gameState.ChosenLeaderCard.Name} : {gameState.ChosenLeaderCard.Nation}");
     System.Console.WriteLine("#############################");
     System.Console.WriteLine($"Focus Bar Slot 1: {gameState.ActiveFocusBar.FocusSlot1.Name}");
     System.Console.WriteLine($"Focus Bar Slot 2: {gameState.ActiveFocusBar.FocusSlot2.Name}");
     System.Console.WriteLine($"Focus Bar Slot 3: {gameState.ActiveFocusBar.FocusSlot3.Name}");
     System.Console.WriteLine($"Focus Bar Slot 4: {gameState.ActiveFocusBar.FocusSlot4.Name}");
     System.Console.WriteLine($"Focus Bar Slot 5: {gameState.ActiveFocusBar.FocusSlot5.Name}");
     System.Console.WriteLine("#############################");
     System.Console.WriteLine($"Unlocked Culture Wonder: {gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Culture]?.Name} ({gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Culture]?.Era}) : {gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Culture]?.Cost}");
     System.Console.WriteLine($"Unlocked Economy Wonder: {gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Economy]?.Name} ({gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Economy]?.Era}) : {gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Economy]?.Cost}");
     System.Console.WriteLine($"Unlocked Science Wonder: {gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Science]?.Name} ({gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Science]?.Era}) : {gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Science]?.Cost}");
     System.Console.WriteLine($"Unlocked Military Wonder: {gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Military]?.Name} ({gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Military]?.Era}) : {gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Military]?.Cost}");
     System.Console.WriteLine("#############################");
     System.Console.WriteLine();
     System.Console.WriteLine("Please go ahead and select leaders for all human players and setup the physical game board as normal.");
     System.Console.WriteLine("No need to deal me in, I will manage my own focus cards, focus bar, technology upgrades, trade tokens and resources.");
     System.Console.WriteLine("");
     System.Console.WriteLine("In order to keep our wonder card decks in sync, please allow me to manage the decks setup and ongoing evolution.");
     System.Console.WriteLine("I have already shuffled the decks for each focus type, removed cards as per the rules and turned over the unlocked wonders available for purchase which can be seen above. ");
     System.Console.WriteLine("You can replicate this wonder card setup by the side of the board to make it easier for human players to reference the wonders available for purchase at any time.");
     System.Console.WriteLine("Whenever I purchase an unlocked wonder during my turn, I will inform you as to how to update the unlocked wonder decks by the side of the board for easy reference.");
     System.Console.WriteLine("During each round, if a human player purchases a wonder they can inform me and I will update the unlocked wonder decks which you can replicate by the side of the board.");
     System.Console.WriteLine("");
     System.Console.WriteLine("For this initial version of the software, I am configured for a two player game using the prologue board setup.");
     System.Console.WriteLine("If I need any physical interaction with the board, I will ask you to do this for me.");
     System.Console.WriteLine("If I need any information about moves that were made I will ask some simple questions.");
     System.Console.WriteLine("All you need to do just now is pick a color for me, place my captial city on the board and set aside my other tokens and models.");
     System.Console.WriteLine("When everything is setup and you are happy to start the game, press any key and I will make the first move.");
     System.Console.ReadKey();
     System.Console.Clear();
 }
예제 #8
0
        private void ExecuteMoveForScope(IServiceScope scope, BotGameState gameState, FocusCardModel focusCard)
        {
            var scopedMoveContext     = scope.ServiceProvider.GetRequiredService <IAutoCivMoveClient>();
            var focusCardMoveResolver = _focusCardResolverFactory.GetFocusCardMoveResolver(focusCard);

            scopedMoveContext.ExecuteMoveForResolver(gameState, focusCardMoveResolver);
        }
예제 #9
0
        /// <summary>
        /// Starts the match.
        /// </summary>
        /// <param name="acpcHeroPosition">This field tells the client their position relative to the dealer button. A value of 0 indicates
        /// that for the current hand, the client is the first player after the button(the small blind in ring games, or
        /// the big blind in reverse-blind heads-up games.)</param>
        private void startTheMatch(int acpcHeroPosition)
        {
            string[] playerNamesHU   = { "Hero", "Villian" };
            string[] playerNames6Max = { "Hero", "V1", "V2", "V3", "V4", "V5" };
            string[] playerNames     = (_tableType == TableType.HeadsUp) ? playerNamesHU : playerNames6Max;

            int buttonInd = (_heroInd - (acpcHeroPosition + 1) + _numPlayers) % _numPlayers;

            Console.WriteLine("Match started");

            var startTime = DateTime.Now;

            _botGameState = new BotGameState(playerNames, _heroInd, buttonInd, _bigBlindSize, _startStackSize, PokerClient.Acpc, _tableType,
                                             new Logic.Estimators.ModelingEstimator(_opponentModeling, PokerClient.Acpc));

            var timeStr = timeToString(DateTime.Now - startTime);

            Console.WriteLine("Made bot game state (Hero ind: " + _heroInd.ToString() +
                              ", Button ind: " + buttonInd.ToString() +
                              ", Start stack size: " + _startStackSize.ToString() + timeStr);

            foreach (var player in _botGameState.getPlayers())
            {
                Console.WriteLine(player.Name + " (" + player.PreFlopPosition + ") stack: " + player.Stack.ToString());
            }
        }
예제 #10
0
        public AcpcGame(TableType tableType)
        {
            _botGameState   = null;
            _prevMatchState = null;

            _tableType      = tableType;
            _heroInd        = 0;
            _bigBlindSize   = 100;
            _startStackSize = 200 * _bigBlindSize;
            _totalSaldo     = 0;

            _options = new OpponentModeling.Options();
            _options.recentHandsCount = 1000;

            var startTime = DateTime.Now;

            if (tableType == TableType.HeadsUp)
            {
                _numPlayers       = 2;
                _opponentModeling = new OpponentModeling("full_stats_list_hu.bin", _bigBlindSize, tableType, _options);
            }
            else if (tableType == TableType.SixMax)
            {
                _numPlayers       = 6;
                _opponentModeling = new OpponentModeling("full_stats_list_6max.bin", _bigBlindSize, tableType, _options);
            }
            else
            {
                throw new InvalidOperationException("Not supported table type");
            }

            var timeStr = timeToString(DateTime.Now - startTime);

            Console.WriteLine("Opponent modeling made (BBSize: " + _bigBlindSize.ToString() + ")" + timeStr);
        }
예제 #11
0
        public async Task <BotGameState> InitialiseNewGame()
        {
            // TODO: hardwired for two player game

            WriteConsoleHeader();

            var initialFocusCards = await _focusCardDeckInitialiser.InitialiseFocusCardsDeck();

            _globalGameCache.FocusCardsDeck = initialFocusCards;

            var initialWonderCards = await _wonderCardDeckInitialiser.InitialiseWonderCardsDeck();

            _globalGameCache.WonderCardsDeck = initialWonderCards;

            var initialCityStates = await _cityStateInitialiser.InitialiseCityStates();

            _globalGameCache.CityStates = initialCityStates;

            var focusBar     = _focusBarInitialiser.InitialiseFocusBarForBot();
            var wonderCards  = _wonderCardDecksInitialiser.InitialiseDecksForBot(PlayerCount);
            var chosenLeader = await _leaderCardInitialiser.InitialiseRandomLeaderForBot();

            var gameState = new BotGameState(focusBar, chosenLeader, wonderCards);

            WriteConsoleGameStart(gameState);
            return(gameState);
        }
예제 #12
0
        public void ExecuteRoundForBot(BotGameState gameState)
        {
            // TODO: we can track the event dial which should move at the start of each of the bots turns (except first)
            //       certain events will require actions - trade tokens etc

            // TODO: human players require the ability to interact with the bot duering their turns
            //       this will happen after the bot has moved but before the round has completed
            //       currently we await any key to continue
            //       instead we should prompt if any player would like to interact with it
            //       options provided should be
            //          - I wish to attack one of the bot cities
            //          - I have purchased a wonder, please update the unlocked cards
            //          - no, please proceed to the bots next move

            // TODO: what if we get a chain of reruns and resets - not sure how this would propegate
            //       e.g. capitalism - play it reset it and draw economy as next active (primary)
            //            ubanization - play it reset it and draw culture as ruled (post -> will add new culture execute to round)
            //            culture - play it reset it (post -> will this get picked up in that same loop even tho added after execution - i think it will exception with changed collection tbh)
            //                      if it does not exception and does not fire in that loop - it will be missed!

            // TODO: need to think about built wonders effects on avilable trade tokens (each wonder provides bonus token for use in a single move) for wonder type that matches resolved focus card
            WriteConsoleRoundHeader(gameState);

            ExecutePrimaryMove(gameState);
            ExecuteSubMoveChains(gameState);

            WriteConsoleAwaitingNextTurn();
            gameState.CurrentRoundNumber++;
        }
예제 #13
0
 private void WriteConsoleRoundHeader(BotGameState gameState)
 {
     System.Console.WriteLine();
     System.Console.WriteLine("########################################################################################");
     System.Console.WriteLine($"Game:\t\t{gameState.GameId}");
     System.Console.WriteLine($"Round:\t\t{gameState.CurrentRoundNumber}");
     System.Console.WriteLine("########################################################################################");
     System.Console.WriteLine($"Friendly City Count:\t\t\t{gameState.FriendlyCityCount}");
     System.Console.WriteLine($"Supported Trade Caravan Count:\t\t{gameState.SupportedCaravanCount}");
     System.Console.WriteLine($"Trade Caravans on Route Count:\t\t{gameState.CaravansOnRouteCount}");
     System.Console.WriteLine($"Controlled Natural Resources:\t\t{gameState.ControlledNaturalResources}");
     System.Console.WriteLine($"Controlled Natural Wonders:\t\t{gameState.ControlledNaturalWondersString}");
     System.Console.WriteLine($"City State Conquered Tokens:\t\t{gameState.CityStateDiplomacyCardsHeldString}");
     System.Console.WriteLine($"City State Diplomacy Cards:\t\t{gameState.CityStateDiplomacyCardsHeldString}");
     System.Console.WriteLine($"Rival Diplomacy Cards:\t\t\t{gameState.VisitedPlayerColorsString}");
     System.Console.WriteLine($"Purchased World Wonders:\t\t{gameState.PurchasedWondersString}");
     System.Console.WriteLine("########################################################################################");
     System.Console.WriteLine($"Unlocked Culture Wonder:\t{gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Culture]?.Name.PadRight(20, ' ')}\t{gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Culture]?.Era.ToString().PadRight(10, ' ')}\tCosts: {gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Culture]?.Cost}");
     System.Console.WriteLine($"Unlocked Economy Wonder:\t{gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Economy]?.Name.PadRight(20, ' ')}\t{gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Economy]?.Era.ToString().PadRight(10, ' ')}\tCosts: {gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Economy]?.Cost}");
     System.Console.WriteLine($"Unlocked Science Wonder:\t{gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Science]?.Name.PadRight(20, ' ')}\t{gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Science]?.Era.ToString().PadRight(10, ' ')}\tCosts: {gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Science]?.Cost}");
     System.Console.WriteLine($"Unlocked Military Wonder:\t{gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Military]?.Name.PadRight(20, ' ')}\t{gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Military]?.Era.ToString().PadRight(10, ' ')}\tCosts: {gameState.WonderCardDecks.UnlockedWonderCards[FocusType.Military]?.Cost}");
     System.Console.WriteLine("########################################################################################");
     System.Console.WriteLine($"Focus Bar Slot 1:\t{gameState.ActiveFocusBar.FocusSlot1.Name.PadRight(20, ' ')} ({gameState.ActiveFocusBar.FocusSlot1.Level} {gameState.ActiveFocusBar.FocusSlot1.Type})\t{gameState.TradeTokens[gameState.ActiveFocusBar.FocusSlot1.Type]} trade tokens available");
     System.Console.WriteLine($"Focus Bar Slot 2:\t{gameState.ActiveFocusBar.FocusSlot2.Name.PadRight(20, ' ')} ({gameState.ActiveFocusBar.FocusSlot2.Level} {gameState.ActiveFocusBar.FocusSlot2.Type})\t{gameState.TradeTokens[gameState.ActiveFocusBar.FocusSlot2.Type]} trade tokens available");
     System.Console.WriteLine($"Focus Bar Slot 3:\t{gameState.ActiveFocusBar.FocusSlot3.Name.PadRight(20, ' ')} ({gameState.ActiveFocusBar.FocusSlot3.Level} {gameState.ActiveFocusBar.FocusSlot3.Type})\t{gameState.TradeTokens[gameState.ActiveFocusBar.FocusSlot3.Type]} trade tokens available");
     System.Console.WriteLine($"Focus Bar Slot 4:\t{gameState.ActiveFocusBar.FocusSlot4.Name.PadRight(20, ' ')} ({gameState.ActiveFocusBar.FocusSlot4.Level} {gameState.ActiveFocusBar.FocusSlot4.Type})\t{gameState.TradeTokens[gameState.ActiveFocusBar.FocusSlot4.Type]} trade tokens available");
     System.Console.WriteLine($"Focus Bar Slot 5:\t{gameState.ActiveFocusBar.FocusSlot5.Name.PadRight(20, ' ')} ({gameState.ActiveFocusBar.FocusSlot5.Level} {gameState.ActiveFocusBar.FocusSlot5.Type})\t{gameState.TradeTokens[gameState.ActiveFocusBar.FocusSlot5.Type]} trade tokens available");
     System.Console.WriteLine("########################################################################################");
     System.Console.WriteLine($"Active Move Focus: {gameState.ActiveFocusBar.FocusSlot5.Name}");
     System.Console.WriteLine("########################################################################################");
 }
예제 #14
0
        public override string UpdateGameStateForMove(BotGameState botGameStateService)
        {
            _industryResolverUtiliity.UpdateBaseIndustryGameStateForMove(_moveState, botGameStateService);

            _currentStep = -1;
            return(BuildMoveSummary());
        }
예제 #15
0
        public BotMoveState CreateBasicMilitaryMoveState(BotGameState botGameStateCache, int baseRange, int basePower, int baseMaxTargetrPower, int noOfAttacks, int baseReinforcments, int baseReinforcemenstCost, int baseBarbarianBonus)
        {
            var _moveState = new BotMoveState();

            _moveState.BaseAttackPower             = basePower;
            _moveState.BaseAttackRange             = baseRange;
            _moveState.BaseMaxTargetPower          = baseMaxTargetrPower;
            _moveState.BaseReinforcementCount      = baseReinforcments;
            _moveState.BaseReinforcementAttackCost = baseReinforcemenstCost;
            _moveState.BaseBarbarianAttackBonus    = baseBarbarianBonus;

            _moveState.ActiveFocusBarForMove        = botGameStateCache.ActiveFocusBar;
            _moveState.TradeTokensAvailable         = new Dictionary <FocusType, int>(botGameStateCache.TradeTokens);
            _moveState.BotPurchasedWonders          = new List <WonderCardModel>(botGameStateCache.BotPurchasedWonders);
            _moveState.AllPurchasedWonders          = new List <WonderCardModel>(botGameStateCache.BotPurchasedWonders);
            _moveState.CityStatesDiplomacyCardsHeld = new List <CityStateModel>(botGameStateCache.CityStateDiplomacyCardsHeld);
            _moveState.ConqueredCityStateTokensHeld = new List <CityStateModel>(botGameStateCache.ConqueredCityStateTokensHeld);
            _moveState.ControlledNaturalWonders     = new List <string>(botGameStateCache.ControlledNaturalWonders);

            _moveState.FriendlyCityCount = botGameStateCache.FriendlyCityCount;

            for (int tc = 0; tc < noOfAttacks; tc++)
            {
                _moveState.AttacksAvailable.Add(tc, new AttackTargetMoveState());
            }
            return(_moveState);
        }
예제 #16
0
        public override string UpdateGameStateForMove(BotGameState gameState)
        {
            _militaryResolverUtility.UpdateBaseMilitaryGameStateForMove(_moveState, gameState, _moveState.CurrentAttackMoveId);

            _currentStep = -1;
            return(BuildMoveSummary());
        }
예제 #17
0
 public void Dispose()
 {
     if (_botGameState != null)
     {
         _botGameState.Dispose();
         _botGameState = null;
     }
 }
예제 #18
0
        public override string UpdateGameStateForMove(BotGameState botGameStateService)
        {
            var techUpgradeResponse = _scienceResolverUtility.UpdateBaseScienceGameStateForMove(_moveState, botGameStateService);

            botGameStateService.TradeTokens[FocusType.Science] = 0;
            _currentStep = -1;
            return(BuildMoveSummary(techUpgradeResponse));
        }
        private string BuildMoveSummary(BotGameState gameState)
        {
            var summary = "To summarise my move I did the following;\n";

            summary  = _economyResolverUtility.BuildGeneralisedEconomyMoveSummary(summary, gameState, _moveState);
            summary += $"\nAs a result of executing this focus card, I will now resolve the card in my 4th focus bar slot without reseting it.\nPlease press any key to execute this action now...\n";
            return(summary);
        }
 public void UpdateBaseIndustryGameStateForMove(BotMoveState moveState, BotGameState botGameStateService)
 {
     botGameStateService.WonderCardDecks             = moveState.ActiveWonderCardDecks;
     botGameStateService.BotPurchasedWonders         = new List <WonderCardModel>(moveState.BotPurchasedWonders);
     botGameStateService.TradeTokens                 = new Dictionary <FocusType, int>(moveState.TradeTokensAvailable);
     botGameStateService.FriendlyCityCount          += moveState.FriendlyCitiesAddedThisTurn;
     botGameStateService.ControlledNaturalResources -= moveState.NaturalResourcesSpentThisTurn;
 }
        public void UpdateBaseCultureGameStateForMove(BotMoveState movesState, BotGameState botGameStateService)
        {
            var totalTokensPlacedThisTurn = movesState.CityControlTokensPlacedThisTurn + movesState.TerritroyControlTokensPlacedThisTurn;

            botGameStateService.ControlledSpaces           += totalTokensPlacedThisTurn;
            botGameStateService.ControlledNaturalResources += (movesState.NaturalResourceTokensControlledThisTurn + movesState.NaturalWonderTokensControlledThisTurn);
            botGameStateService.ControlledNaturalWonders    = new List <string>(movesState.ControlledNaturalWonders);
            botGameStateService.TradeTokens = new Dictionary <FocusType, int>(movesState.TradeTokensAvailable);
        }
예제 #22
0
 private void ExecutePrimaryMove(BotGameState gameState)
 {
     using (var primaryMoveScope = _serviceScopeFactory.CreateScope())
     {
         var focusCardToExecute = gameState.ActiveFocusBar.ActiveFocusSlot;
         ExecuteMoveForScope(primaryMoveScope, gameState, focusCardToExecute);
         ResetFocusBarForNextMove(gameState);
     }
 }
예제 #23
0
        public override string UpdateGameStateForMove(BotGameState botGameStateService)
        {
            var freeUpgradeResponse = _technologyUpgradeResolver.ResolveFreeTechnologyUpdate(_moveState.ActiveFocusBarForMove);
            var techUpgradeResponse = _scienceResolverUtility.UpdateBaseScienceGameStateForMove(_moveState, botGameStateService);

            botGameStateService.TradeTokens[FocusType.Science] = 0;
            _currentStep = -1;
            return(BuildMoveSummary(freeUpgradeResponse, techUpgradeResponse));
        }
        public BotMoveState CreateBasicCultureMoveState(BotGameState botGameStateCache, int baseTokens)
        {
            var moveState = new BotMoveState();

            moveState.ControlledNaturalWonders        = new List <string>(botGameStateCache.ControlledNaturalWonders);
            moveState.TradeTokensAvailable            = new Dictionary <FocusType, int>(botGameStateCache.TradeTokens);
            moveState.BaseCityControlTokensToBePlaced = baseTokens;
            return(moveState);
        }
예제 #25
0
        public BotMoveState CreateBasicScienceMoveState(BotGameState botGameStateCache, int basePoints)
        {
            var moveState = new BotMoveState();

            moveState.ActiveFocusBarForMove   = botGameStateCache.ActiveFocusBar;
            moveState.StartingTechnologyLevel = botGameStateCache.TechnologyLevel;
            moveState.TradeTokensAvailable    = new Dictionary <FocusType, int>(botGameStateCache.TradeTokens);
            moveState.BaseTechnologyIncrease  = basePoints;
            return(moveState);
        }
예제 #26
0
 public override void PrimeMoveState(BotGameState botGameStateService)
 {
     _moveState = _industryResolverUtiliity.CreateBasicIndustryMoveState(botGameStateService, BaseProduction, BaseCityDistance);
     _moveState.CanMoveOnWater = true;
     _botRoundStateCache.SubMoveConfigurations.Add(new SubMoveConfiguration()
     {
         AdditionalFocusTypeToExecuteOnFocusBar = FocusType.Culture,
         ShouldResetSubFocusCard = true,
     });
 }
        public override void PrimeMoveState(BotGameState botGameStateService)
        {
            // TODO: the bot round state cache is suspicious here - same the old move state cache

            _moveState = _economyResolverUtility.CreateBasicEconomyMoveState(botGameStateService, SupportedCaravans, BaseCaravanMoves);
            _moveState.CanMoveOnWater = true;
            _botRoundStateCache.SubMoveConfigurations.Add(new SubMoveConfiguration()
            {
                AdditionalFocusTypeToExecuteOnFocusBar = _moveState.ActiveFocusBarForMove.FocusSlot4.Type,
                ShouldResetSubFocusCard = false,
            });
        }
예제 #28
0
        void IActionEstimator.newAction(ActionType actionType, BotGameState gameState)
        {
            float betRaiseProb  = 0.0f;
            float checkCallProb = 0.0f;

            getPlayerToActAD(ref betRaiseProb, ref checkCallProb, gameState);

            gameState.getPlayerToAct().CutRange(actionType,
                                                gameState.getStreet(),
                                                gameState.getBoard(),
                                                betRaiseProb,
                                                checkCallProb, _dmContext);
        }
        public BotMoveState CreateBasicEconomyMoveState(BotGameState botGameStateCache, int supportedCaravans, int baseMoves)
        {
            var moveState = new BotMoveState();

            moveState.ActiveFocusBarForMove = botGameStateCache.ActiveFocusBar;
            moveState.TradeTokensAvailable  = new Dictionary <FocusType, int>(botGameStateCache.TradeTokens);
            moveState.BaseCaravanMoves      = baseMoves;
            moveState.SupportedCaravanCount = supportedCaravans;

            for (int tc = 0; tc < moveState.SupportedCaravanCount; tc++)
            {
                moveState.TradeCaravansAvailable.Add(tc, new TradeCaravanMoveState());
            }
            return(moveState);
        }
        public override string UpdateGameStateForMove(BotGameState gameState)
        {
            _militaryResolverUtility.UpdateBaseMilitaryGameStateForMove(_moveState, gameState, _moveState.CurrentAttackMoveId);

            FocusBarUpgradeResponse freeUpgrade = new FocusBarUpgradeResponse(false, _moveState.ActiveFocusBarForMove, _moveState.ActiveFocusBarForMove.ActiveFocusSlot, null);

            if (!_moveState.AttacksAvailable.All(x => !x.Value.IsTargetWithinRange) && _moveState.ControlTokensReinforcedThisTurn == 0)
            {
                freeUpgrade = _focusBarTechnologyUpgradeResolver.RegenerateFocusBarSpecificTechnologyLevelUpgrade(_moveState.ActiveFocusBarForMove, FocusType.Military);
                gameState.ActiveFocusBar = freeUpgrade.UpgradedFocusBar;
            }

            _currentStep = -1;
            return(BuildMoveSummary(freeUpgrade));
        }