protected sealed override IEnumerator ProcessPayload(VisualPayload payload) { var windowVisualizer = GetWindowVisualizer(payload); windowVisualizer.RequestColor = RequestColorField.GetFirstValue(payload.Data); windowVisualizer.FilamentColor = FilamentColorField.GetFirstValue(payload.Data); windowVisualizer.RequestTeamLogo = RequestTeamLogoField.GetFirstValue(payload.Data); windowVisualizer.BinaryId = BinaryIdField.GetFirstValue(payload.Data); windowVisualizer.BinsetTeamIndices = BinsetTeamIndices.GetFirstValue(payload.Data); windowVisualizer.BinsetShortName = BinsetShortNameField.GetFirstValue(payload.Data); windowVisualizer.RequestId = RequestIdField.GetFirstValue(payload.Data); windowVisualizer.RequestNature = RequestNatureField.GetFirstValue(payload.Data); windowVisualizer.ElementCount = ElementCountField.GetFirstValue(payload.Data); // Order issue, must come after RequestNature! windowVisualizer.Success = SuccessField.GetFirstValue(payload.Data); windowVisualizer.PovType = PovTypeField.GetFirstValue(payload.Data); windowVisualizer.ShowDisassembly = ShowDisassemblyField.GetFirstValue(payload.Data); windowVisualizer.ShowComms = ShowCommsField.GetFirstValue(payload.Data); yield return(null); }
public override IEnumerator ReceivePayload(VisualPayload payload) { if (!SpoofData.GetFirstValue(payload.Data)) { var requestNature = RequestNatureField.GetFirstValue(payload.Data); var requestId = RequestIdField.GetFirstValue(payload.Data); var command = new GetPovInfoCommand(requestId); var team = 0; if (requestNature == RequestNature.Pov && requestId > 0) { var commandIterator = CommandProcessor.Execute(command); while (commandIterator.MoveNext()) { yield return(null); } team = command.TeamId; } //var info = new MutableObject(); // //if ( requestNature == RequestNature.Pov ) //{ // var commandIterator = CommandProcessor.Execute( command ); // while ( commandIterator.MoveNext() ) // yield return null; // info[ "Team" ] = command.Team; // info[ "CsId" ] = command.CsId; // info[ "File" ] = command.File; // info[ "Submissions" ] = new List< MutableObject > { // new MutableObject { // { "Id", command.Submissions[0].Id }, // { "Round", command.Submissions[0].Round }, // { "Target", command.Submissions[0].Target }, // { "ThrowCount", command.Submissions[0].ThrowCount }, // } // }; //} //else //{ // // These are so incorrect, I have simplified this entire class to just return the requesting team id. // // info["Team"] = 8; // info["CsId"] = 0; // info["File"] = ""; // info["Submissions"] = new List<MutableObject> { // new MutableObject { // { "Id", 0 }, // { "Round", 0 }, // { "Target", 0 }, // { "ThrowCount", 0 }, // } // }; //} //var info = new MutableObject { // {"Team", team} //}; TeamTarget.SetValue(team, payload.Data); } else { TeamTarget.SetValue(3, payload.Data); } var routerIterator = Router.TransmitAll(payload); while (routerIterator.MoveNext()) { yield return(null); } }