예제 #1
0
        public object GetResponse(WebService service)
        {
            StrategyComparisonResults comparisonResults = service.GetResultsFor(this);

            if (comparisonResults == null)
            {
                return null;
            }

            var data = new List<object>();
            data.Add(new string[] { "Player", "Percent" });

            for (int index = 0; index < comparisonResults.winnerCount.Length; ++index)
            {
                data.Add(new object[] { comparisonResults.comparison.playerActions[index].PlayerName, comparisonResults.PlayerWinPercent(index) });
            }
            if (comparisonResults.tieCount > 0)
            {
                data.Add(new object[] { "Tie", comparisonResults.TiePercent });
            }

            var options = new Dictionary<string, object>();
            options.Add("title", "Game Breakdown");

            var result = new Dictionary<string, object>();
            result.Add("data", data);
            result.Add("options", options);
            result.Add("type", "pie");
            return result;
        }
        public object GetResponse(WebService service)
        {
            StrategyComparisonResults comparisonResults = service.GetResultsFor(this);

            return GetLineGraphData(comparisonResults,
                "Coin To Spend Per Turn",
                comparisonResults.statGatherer.coinToSpend);
        }
        public object GetResponse(WebService service)
        {
            StrategyComparisonResults comparisonResults = service.GetResultsFor(this);

            return GetLineGraphData(comparisonResults,
                "Victory Point Total Per Turn",
                comparisonResults.statGatherer.victoryPointTotal);
        }
        public object GetResponse(WebService service)
        {
            StrategyComparisonResults comparisonResults = service.GetResultsFor(this);

            return GetLineGraphData(comparisonResults,
                "Probability player is ahead in points at end of round ",
                comparisonResults.statGatherer.oddsOfBeingAheadOnRoundEnd);
        }
예제 #5
0
        public object GetResponse(WebService service)
        {
            StrategyComparisonResults comparisonResults = service.GetResultsFor(this);
            if (comparisonResults == null)
                return null;

            string result = comparisonResults.comparison.GetHumanReadableGameLog(gameNumber - 1);

            return result;
        }
        public object GetResponse(WebService service)
        {
            var result = new Dictionary<string, object>();

            DynamicStrategyLoader.CompiledResult compiledResult = Program.strategyLoader.DynamicallyLoadFromSource(this.code);
            if (compiledResult.error != null)
            {
                result.Add("line", compiledResult.error.Line);
                result.Add("column", compiledResult.error.Column);
                result.Add("message", compiledResult.error.ErrorText);
            }
            return result;
        }
예제 #7
0
        public object GetResponse(WebService service)
        {
            StrategyComparisonResults comparisonResults = service.GetResultsFor(this);

            var options = GoogleChartsHelper.GetLineGraphOptions(
                "Point Spread",
                "Score",
                "Percentage",
                comparisonResults.pointSpreadHistogramData.GetXAxis(),
                comparisonResults.pointSpreadHistogramData.GetYAxis());

            return options;
        }
        public object GetResponse(WebService service)
        {
            var playerActions = new List<PlayerAction>();
            var player1 = this.Player1Action;
            if (player1 != null)
                playerActions.Add(player1);
            var player2 = this.Player2Action;
            if (player2 != null)
                playerActions.Add(player2);

            var builder = new GameConfigBuilder();
            builder.SetKingdomCards(playerActions.ToArray());
            return builder.ToGameConfig().kingdomPiles.OrderBy(card => card.DefaultCoinCost).Select(card => GetCardImageName(card)).ToArray();
        }
        public object GetResponse(WebService service)
        {
            StrategyComparisonResults comparisonResults = service.GetResultsFor(this);

            int maxTurn = comparisonResults.gameEndOnTurnHistogramData.GetXAxisValueCoveringUpTo(97);

            var options = GoogleChartsHelper.GetLineGraphOptions(
                "Probablity of Game Being over by turn",
                "Score",
                "Percentage",
                comparisonResults.gameEndOnTurnHistogramData.GetXAxis(maxTurn),
                comparisonResults.gameEndOnTurnHistogramData.GetYAxisIntegrated(maxTurn));

            return options;
        }
 public object GetResponse(WebService service)
 {
     return WebService.availaleGraphs.Select(t => t.Name).ToArray();
 }
예제 #11
0
 public object GetResponse(WebService service)
 {
     return Program.strategyLoader.GetPlayerSource(this.name);
 }
 public object GetResponse(WebService service)
 {
     return Program.strategyLoader.AllStrategies().Select(action => action.PlayerName).OrderBy(name => name).ToArray();
 }
 public string GetResponse(WebService service)
 {
     StrategyComparisonResults comparisonResults = service.GetResultsFor(this);
     var HtmlReportGenerator = new HtmlRenderer.HtmlReportGenerator(comparisonResults);
     return HtmlReportGenerator.CreateHtmlReport();
 }
예제 #14
0
 public object GetResponse(WebService service)
 {
     return(Cards.AllKingdomCards().Select(c => GetCardForJason(c)).ToArray());
 }
예제 #15
0
 public object GetResponse(WebService service)
 {
     return Cards.AllKingdomCards().Select(c => GetCardForJason(c)).ToArray();
 }
 public object GetResponse(WebService service)
 {
     return(Program.strategyLoader.AllStrategies().Select(action => action.PlayerName).OrderBy(name => name).ToArray());
 }