private static ShardState ShardStateFrom(Proto.Msg.ShardState state) { var set = new HashSet <string>(); foreach (var id in state.EntityIds) { set.Add(id); } return(new ShardState(state.ShardId, set.ToImmutableHashSet())); }
// ShardState private static Proto.Msg.ShardState ShardStateToProto(ShardState state) { var p = new Proto.Msg.ShardState(); p.ShardId = state.ShardId; foreach (var id in state.EntityIds) { p.EntityIds.Add(id); } return(p); }