public virtual void resultAdded(Result result) { Networking.ResultDTO resultDto = DTOUtils.getDTO(result); Console.WriteLine("Result added " + result); try { sendResponse(ProtoUtils.createNewResultResponse(resultDto)); } catch (Exception e) { throw new TriatlonException("Sending error: " + e); } }
public static Response createNewResultResponse(Networking.ResultDTO result) { Protobuff.ResultDTO resultDto = new ResultDTO { ParticipantId = result.IdParticipant, StageId = result.IdStage, Score = result.Score }; Response response = new Response { Type = Response.Types.ResponseType.NewResult, Result = resultDto }; return(response); }
public static Request createAddResultRequest(Networking.ResultDTO result) { Protobuff.ResultDTO resultDto = new ResultDTO { ParticipantId = result.IdParticipant, StageId = result.IdStage, Score = result.Score }; Request request = new Request { Type = Request.Types.RequestType.AddResult, Result = resultDto }; return(request); }
public AddResultRequest(ResultDTO result) { this.result = result; }