public static string GetJSONVotes(bool isRestCall, string url, string playerList, string replacementList, string moderatorNamesInput, string colorCode, string dayStartList = null, string deadListText = null, string dayviggedList = null, string priorVCNumberInput = null, string optionalFlavorText = null, string optionalDeadlineText = null, string optionalVoteOverrideData = null, string playerName = null, string _prodTimer = null, string _fontOverride = null, bool _areaTagsOn = true, string _dividerOverride = null, bool _showLLevel = false, bool _showZeroCountWagons = false)
        {
            VoteServiceObject vso = BuildBaseVoteObject(isRestCall, url, playerList, replacementList, moderatorNamesInput, colorCode, dayStartList, deadListText, dayviggedList, priorVCNumberInput, optionalFlavorText, optionalDeadlineText, optionalVoteOverrideData, _prodTimer, _fontOverride, _areaTagsOn, _dividerOverride, _showLLevel, _showZeroCountWagons);

            if (vso.ErrorMessage != null)
            {
                return(vso.ErrorMessage);
            }
            else
            {
                if (!string.IsNullOrEmpty(playerName))
                {
                    Player player = Player.FindPlayerByNameUserAidReplacementsLoop(vso.Players, playerName, vso.Replacements);
                    if (player != null)
                    {
                        return(vso.VoteStringByPlayer(player));
                    }
                    else
                    {
                        return("Player named " + playerName + " not found. Please check data entry.");
                    }
                }
                else
                {
                    return(vso.AllVotesString);
                }
            }
        }
        public static string BuildWagonDataOfAllTypes(VoteServiceObject vso)
        {
            string            allWagonData = "";
            VoteServiceObject clonedVSO    = vso.DeepClone <VoteServiceObject>();

            int         settingsCount     = 3;
            List <bool> defaultVCSettings = new List <bool>();

            defaultVCSettings.Add(true);
            defaultVCSettings.Add(false);
            defaultVCSettings.Add(true);



            ResultsObject defaultResultObject = null;

            List <ResultsObject> resultsObjects = new List <ResultsObject>();

            List <HistoryServiceObject> hsosToParse = new List <HistoryServiceObject>();

            for (int i = 0; i < Math.Pow(2, settingsCount); i++)
            {
                BitArray             b         = new BitArray(new int[] { i });
                IEnumerable <bool>   boolArray = b.Cast <bool>().Select(bit => bit ? true : false).ToArray().Take(settingsCount);
                HistoryServiceObject hso       = new HistoryServiceObject(clonedVSO, boolArray.ElementAt(0), boolArray.ElementAt(1), boolArray.ElementAt(2));

                resultsObjects.Add(BuildHistoryLogic.BuildOneResultsObject(hso));
                clonedVSO = vso.DeepClone <VoteServiceObject>();

                if (defaultResultObject == null)
                {
                    if (boolArray.SequenceEqual(defaultVCSettings))
                    {
                        defaultResultObject = resultsObjects[i];
                    }
                }

                allWagonData += resultsObjects[i].WagonText;
            }

            return(allWagonData);
        }
        public static string GetCurrentVoteCount(bool isRestCall, string url, string playerList, string replacementList, string moderatorNames, string dayStartList, string deadListText, string dayviggedText, string priorVCNumberInput, string colorCode, string optionalFlavorText, string optionalDeadlineText, string optionalVoteOverrideData, bool alphabeticalSort = true, bool simple = true, bool lSort = true, bool cleanDay = false, bool displayAllVCs = false, String _prodTimer = null, string _fontOverride = null, bool _areaTagsOn = true, string _dividerOverride = null, bool _showLLevel = false, bool _showZeroCountWagons = false)
        {
            VoteServiceObject vso = BuildBaseVoteObject(isRestCall, url, playerList, replacementList, moderatorNames, colorCode, dayStartList, deadListText, dayviggedText, priorVCNumberInput, optionalFlavorText, optionalDeadlineText, optionalVoteOverrideData, _prodTimer, _fontOverride, _areaTagsOn, _dividerOverride, _showLLevel, _showZeroCountWagons);

            if (vso.ErrorMessage != null)
            {
                return(vso.ErrorMessage);
            }
            else
            {
                try
                {
                    return(BuildHistoryLogic.BuildVoteCount(BuildHistoryLogic.BuildHistoryObject(vso, alphabeticalSort, simple, lSort, cleanDay, displayAllVCs)));
                }
                catch (Exception e)
                {
                    return("An error occurred while processing the votes. Please check input data or give MathBlade a PM with the thread and post number.");// + "MESSAGE: " + message + "INNER EXCEPTION: " + innerExceptionMessage + "STACK TRACE: " + e.StackTrace + "url=" + host;
                }
            }
        }
 public static HistoryServiceObject BuildHistoryObject(VoteServiceObject vso, bool sortBy, bool simple, bool lSort, bool cleanDay, bool displayAllVCs)
 {
     return(new HistoryServiceObject(vso, sortBy, simple, lSort, cleanDay, displayAllVCs));
 }
 public static HistoryServiceObject BuildHistoryObject(VoteServiceObject vso, bool sortBy, bool simple, bool lSort)
 {
     return(new HistoryServiceObject(vso, sortBy, simple, lSort, false, false));
 }
 public static HistoryServiceObject BuildHistoryObject(VoteServiceObject vso)
 {
     return(new HistoryServiceObject(vso, false, false, false));
 }