public com.kodgames.corgi.protocol.RoundRecord ToProtobuf() { com.kodgames.corgi.protocol.RoundRecord record = new com.kodgames.corgi.protocol.RoundRecord { roundType = this.roundType, teamIndex = this.teamIndex, rowIndex = this.rowIndex, roundIndex = this.roundIndex }; foreach (WeihuaGames.ClientClass.TurnRecord record2 in this.turnRecords) { record.turnRecords.Add(record2.ToProtobuf()); } if (this.configParameterDic != null) { record.customRoundParameters.Clear(); foreach (KeyValuePair <string, string> pair in this.configParameterDic) { com.kodgames.corgi.protocol.ConfigParameter item = new com.kodgames.corgi.protocol.ConfigParameter { name = pair.Key, value = pair.Value }; record.customRoundParameters.Add(item); } } return(record); }
public WeihuaGames.ClientClass.RoundRecord FromProtobuf(com.kodgames.corgi.protocol.RoundRecord roundRecord) { //this.roundType = roundRecord.roundType; //this.teamIndex = roundRecord.teamIndex; //this.rowIndex = roundRecord.rowIndex; //this.roundIndex = roundRecord.roundIndex; //foreach (com.kodgames.corgi.protocol.TurnRecord record in roundRecord.turnRecords) //{ // this.turnRecords.Add(new WeihuaGames.ClientClass.TurnRecord().FromProtobuf(record)); //} //this.configParameterDic = new Dictionary<string, string>(); //foreach (com.kodgames.corgi.protocol.ConfigParameter parameter in roundRecord.customRoundParameters) //{ // if (!this.configParameterDic.ContainsKey(parameter.name)) // { // this.configParameterDic.Add(parameter.name, parameter.value); // } // else // { // Logger.Error("[RoundRecord] ConfigParameter repeated. parameter name=" + parameter.name, new object[0]); // } //} return(this); }