コード例 #1
0
        private List <MutableObject> ParseRoundData(MutableObject mutable, RoundScores scoresEntry)
        {
            var teamsList = new List <MutableObject>();

            foreach (var team in scoresEntry)
            {
                //var teamColor = ColorUtility.HsvtoRgb((float)randomGen.NextDouble(), .8f, 1f);

                var teamColor = TeamColorPalette.ColorFromIndex(team.TeamID);

                var scoresList = new List <MutableObject>();

                foreach (var entry in team.SubmissionScores)
                {
                    var newMutable = TurnSubmissionIntoMutable(entry, team, teamColor);

                    scoresList.Add(newMutable);
                }

                var teamEntry = new MutableObject()
                {
                    { "Team Name", team.TeamName },
                    { "Team Id", team.TeamID },
                    { "Team Color", teamColor },
                    { "Scores", scoresList }
                };

                teamsList.Add(teamEntry);
            }

            return(teamsList);
        }
コード例 #2
0
        private List <MutableObject> ParseRoundData(MutableObject mutable, RoundScores scoresEntry, int roundNum)
        {
            //var randomGen = new Random(1337);

            var scoresList = new List <MutableObject>();

            foreach (var team in scoresEntry)
            {
                //var teamColor = ColorUtility.HsvtoRgb((float)randomGen.NextDouble(), .8f, 1f);

                var teamColor = TeamColorPalette.ColorFromIndex(team.TeamID);

                foreach (var entry in team.SubmissionScores)
                {
                    var newMutable = TurnSubmissionIntoMutable(entry, team, teamColor);

                    newMutable["Team Name"]    = team.TeamName;
                    newMutable["Team ID"]      = team.TeamID;
                    newMutable["Team Color"]   = teamColor;
                    newMutable["Round Number"] = roundNum;

                    scoresList.Add(newMutable);
                }
            }

            return(scoresList);
        }
コード例 #3
0
        private VisualPayload ParseData()
        {
            //var randomGen = new Random(1337);

            var mutablesList = new List <MutableObject>();

            foreach (var team in ScoreFromJsonFilter.LoadedTeams)
            {
                //var teamColor = ColorUtility.HsvtoRgb((float)randomGen.NextDouble(), .8f, 1f);

                var teamColor = TeamColorPalette.ColorFromIndex(team.TeamID);

                foreach (var entry in team.SubmissionScores)
                {
                    var newMutable = TurnSubmissionIntoMutable(entry, team, teamColor);

                    mutablesList.Add(newMutable);
                }
            }

            ScoreTarget.SetValue(mutablesList, Payload.Data);

            var groupId = GroupId.GetFirstValue(Payload.Data);

            var index = (DataShare.ContainsKey(groupId)
                ? DataShare[groupId]
                : 0);

            if (groupId != "")
            {
                DataShare[groupId] = index + 1;
            }

            IndexField.SetValue(index, Payload.Data);

            return(Payload);
        }