public void Serialize(BitBuffer buffer) { buffer.EnqueueInt(playerPositions.Count); foreach (KeyValuePair <int, Position> entry in playerPositions) { buffer.EnqueueInt(entry.Key); buffer.EnqueueSerializable(entry.Value); } }