Ejemplo n.º 1
0
        private static void InsertCardData(
            HtmlRenderer htmlWriter,
            string title,
            CardGameSubset gameSubset,
            MapOfCardsForGameSubset <ForwardAndReversePerTurnPlayerCounters> statsPerCard,
            ForwardAndReversePerTurnPlayerCounters turnCounts,
            int playerIndex,
            int throughTurn)
        {
            Card[]    cards       = gameSubset.OrderBy(card => card.DefaultCoinCost).ToArray();
            string[]  seriesLabel = new string[cards.Length];
            int[]     xAxis       = Enumerable.Range(1, throughTurn).ToArray();
            float[][] seriesData  = new float[cards.Length][];

            for (int i = 0; i < cards.Length; i++)
            {
                seriesLabel[i] = cards[i].name;
                seriesData[i]  = statsPerCard[cards[i]].forwardTotal.GetAveragePerTurn(playerIndex, throughTurn, turnCounts.forwardTotal);
            }

            htmlWriter.InsertExpander(title, delegate()
            {
                htmlWriter.InsertLineGraph(title, "Turn", seriesLabel, xAxis, seriesData);
            }, collapseByDefault: true);
        }
Ejemplo n.º 2
0
        private static void InsertCardData(HtmlRenderer htmlWriter, MapOfCardsForGameSubset <PlayerCounterSeparatedByGame> map, CardGameSubset gameSubset, PlayerAction player1, PlayerAction player2)
        {
            var cards       = gameSubset.OrderBy(c => c.DefaultCoinCost);
            var player1Data = new List <float>();
            var player2Data = new List <float>();

            foreach (Card card in cards)
            {
                player1Data.Add(map[card].GetAverage(playerIndex: 0));
                player2Data.Add(map[card].GetAverage(playerIndex: 1));
            }

            htmlWriter.InsertExpander("Cards Report", delegate()
            {
                htmlWriter.InsertColumnChart(
                    "Average Count of Cards Owned at End of Game",
                    "Card",
                    new string[] { player1.PlayerName, player2.PlayerName },
                    cards.Select(c => c.name).ToArray(),
                    new float[][] { player1Data.ToArray(), player2Data.ToArray() });
            }, collapseByDefault: false);
        }
        private static void InsertCardData(HtmlRenderer htmlWriter, MapOfCardsForGameSubset<PlayerCounterSeparatedByGame> map, CardGameSubset gameSubset, PlayerAction player1, PlayerAction player2)
        {
            var cards = gameSubset.OrderBy(c => c.DefaultCoinCost);
            var player1Data = new List<float>();
            var player2Data = new List<float>();

            foreach (Card card in cards)
            {
                player1Data.Add(map[card].GetAverage(playerIndex: 0));
                player2Data.Add(map[card].GetAverage(playerIndex: 1));
            }

            htmlWriter.InsertExpander("Cards Report", delegate()
            {
                htmlWriter.InsertColumnChart(
                    "Average Count of Cards Owned at End of Game",
                    "Card",
                    new string[] { player1.PlayerName, player2.PlayerName},
                    cards.Select(c => c.name).ToArray(),
                    new float[][] { player1Data.ToArray(), player2Data.ToArray() });
            }, collapseByDefault: false);
        }
        private static void InsertCardData(
            HtmlRenderer htmlWriter,
            string title,
            CardGameSubset gameSubset,
            MapOfCardsForGameSubset<ForwardAndReversePerTurnPlayerCounters> statsPerCard,
            ForwardAndReversePerTurnPlayerCounters turnCounts,
            int playerIndex,
            int throughTurn)
        {
            Card[] cards = gameSubset.OrderBy(card => card.DefaultCoinCost).ToArray();
            string[] seriesLabel = new string[cards.Length];
            int[] xAxis = Enumerable.Range(1, throughTurn).ToArray();
            float[][] seriesData = new float[cards.Length][];

            for (int i = 0; i < cards.Length; i++)
            {
                seriesLabel[i] = cards[i].name;
                seriesData[i] = statsPerCard[cards[i]].forwardTotal.GetAveragePerTurn(playerIndex, throughTurn, turnCounts.forwardTotal);
            }

            htmlWriter.InsertExpander(title, delegate()
            {
                htmlWriter.InsertLineGraph(title, "Turn", seriesLabel, xAxis, seriesData);
            }, collapseByDefault: true);
        }