public static Protobuf.Player CreateBufferedPlayer(Player player) { var translation = new Protobuf.Player(); translation.PlayerId = player.PlayerId; translation.Team = player.Team; if (player.LatencyInMS != null) { translation.LatencyInMs = new Dictionary <string, int>(); foreach (KeyValuePair <string, int> entry in player.LatencyInMS) { translation.LatencyInMs.Add(entry.Key, entry.Value); } } if (player.PlayerAttributes != null) { translation.PlayerAttributes = new Dictionary <string, Protobuf.AttributeValue>(); foreach (KeyValuePair <string, AttributeValue> entry in player.PlayerAttributes) { translation.PlayerAttributes.Add(entry.Key, BackfillDataMapper.CreateBufferedAttributeValue(entry.Value)); } } return(translation); }
public static Com.Amazon.Whitewater.Auxproxy.Pbuffer.Player CreateBufferedPlayer(Player player) { var translation = new Com.Amazon.Whitewater.Auxproxy.Pbuffer.Player(); translation.PlayerId = player.PlayerId; translation.Team = player.Team; if (player.LatencyInMS != null) { foreach (KeyValuePair <string, int> entry in player.LatencyInMS) { translation.LatencyInMs.Add(entry.Key, entry.Value); } } if (player.PlayerAttributes != null) { foreach (KeyValuePair <string, AttributeValue> entry in player.PlayerAttributes) { translation.PlayerAttributes.Add(entry.Key, BackfillDataMapper.CreateBufferedAttributeValue(entry.Value)); } } return(translation); }