Beispiel #1
0
        protected override void OnProcessOutputSchema(MutableObject newSchema)
        {
            // We don't modify the input schema in adapters... We may derive values from input schemas, but adapters always send a novel schema...

            var oneMutable = TurnSubmissionIntoMutable(new SubmissionScore(), new TeamScores(), Color.magenta);

            var mutableCollection = new List <MutableObject> {
                oneMutable
            };

            ScoreTarget.SetValue(mutableCollection, newSchema);
            IndexField.SetValue(1, newSchema);

            Router.TransmitAllSchema(newSchema);
        }
Beispiel #2
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);
        }