public void Respond(Messages.Response.StatusType status, Dictionary <string, double> fitness, Dictionary <string, string> data) { Messages.Response resp = new Messages.Response(); resp.Id = 0; resp.Status = status; List <Messages.Response.FitnessType> ff = new List <Messages.Response.FitnessType>(); foreach (KeyValuePair <string, double> pair in fitness) { Messages.Response.FitnessType f = new Messages.Response.FitnessType(); f.Name = pair.Key; f.Value = pair.Value; ff.Add(f); } resp.Fitness = ff.ToArray(); List <Messages.Response.KeyValueType> dd = new List <Messages.Response.KeyValueType>(); foreach (KeyValuePair <string, string> pair in data) { Messages.Response.KeyValueType kv = new Messages.Response.KeyValueType(); kv.Key = pair.Key; kv.Value = pair.Value; dd.Add(kv); } resp.Data = dd.ToArray(); Response(resp); }
public void Respond(Messages.Response.StatusType status, Dictionary <string, double> fitness) { Dictionary <string, string> data = new Dictionary <string, string>(); Respond(status, fitness, data); }