public int GetMyIncome() { PlayerIDType myId = GameState.MyPlayerId; PlayerIncome income = Incomes[myId]; return(income.FreeArmies); }
public void Init(GameIDType gameID, PlayerIDType myPlayerID, Dictionary <PlayerIDType, GamePlayer> players, MapDetails map, GameStanding distributionStanding, GameSettings gameSettings, int numberOfTurns, Dictionary <PlayerIDType, PlayerIncome> incomes, GameOrder[] prevTurn, GameStanding latestTurnStanding, GameStanding previousTurnStanding, Dictionary <PlayerIDType, TeammateOrders> teammatesOrders, List <CardInstance> cards, int cardsMustPlay, Stopwatch timer, List <string> directives) { this.DistributionStandingOpt = distributionStanding; this.Standing = latestTurnStanding; this.PlayerID = myPlayerID; this.Players = players; this.Map = map; this.Settings = gameSettings; this.TeammatesOrders = teammatesOrders; this.Cards = cards; this.CardsMustPlay = cardsMustPlay; this.Incomes = incomes; this.BaseIncome = Incomes[PlayerID]; this.EffectiveIncome = BaseIncome.Clone(); this.Neighbors = players.Keys.ExceptOne(PlayerID).ConcatOne(TerritoryStanding.NeutralPlayerID).ToDictionary(o => o, o => new Neighbor(this, o)); this.Opponents = players.Values.Where(o => o.State == GamePlayerState.Playing && !IsTeammateOrUs(o.ID)).ToList(); this.IsFFA = Opponents.Count > 1 && (Opponents.Any(o => o.Team == PlayerInvite.NoTeam) || Opponents.GroupBy(o => o.Team).Count() > 1); this.WeightedNeighbors = WeightNeighbors(); this.Timer = timer; this.Directives = directives; if (tracker.isInit()) { tracker.update(this); } else { tracker.init(this); } AILog.Log("BotMain", "PyBot initialized. Starting at " + timer.Elapsed.TotalSeconds + " seconds"); }
public TakePlayingTurnContainer(MapDetails map, GameStanding noFogStanding, Dictionary <PlayerIDType, GamePlayer> players, GameSettings settings, PlayerIDType player, PlayerIncome income, List <CardInstance> cards, int cardsMustPlay, Dictionary <PlayerIDType, TeammateOrders> activeOrders, Stopwatch aiTimer) { this.Map = map; this.Standing = noFogStanding; this.Players = players; this.Settings = settings; this.PlayerID = player; this.Income = income; this.Cards = cards; this.CardsMustPlay = cardsMustPlay; this.TeammatesOrders = activeOrders; this._aiTimer = aiTimer; Orders = new List <GameOrder>(); Neighbors = players.Keys.ExceptOne(player).ConcatOne(TerritoryStanding.NeutralPlayerID).ToDictionary(o => o, o => new Neighbor(this, o)); BuildOrders(); }
public void Init(GameIDType gameID, PlayerIDType myPlayerID, Dictionary <PlayerIDType, GamePlayer> players, MapDetails map, GameStanding distributionStanding, GameSettings gameSettings, int numberOfTurns, Dictionary <PlayerIDType, PlayerIncome> incomes, GameOrder[] prevTurn, GameStanding latestTurnStanding, GameStanding previousTurnStanding, Dictionary <PlayerIDType, TeammateOrders> teammatesOrders, List <CardInstance> cards, int cardsMustPlay, Stopwatch timer, List <string> directives) { this.Me = players[myPlayerID]; this.Players = players; this.NumberOfTurns = numberOfTurns; this.Settings = gameSettings; this.Map = map; this.DistributionStanding = distributionStanding; this.LatestStanding = latestTurnStanding; this.PreviousTurnStanding = previousTurnStanding; this.MyIncome = incomes[myPlayerID]; this.PreviousTurn = prevTurn; //teammatesOrders //cards //cardsMustPlay this.BotMap = new BotMap(this, Map, LatestStanding ?? DistributionStanding); }