private void RecretaeMap() { HashSet <IAabb> all = new HashSet <IAabb>(); if (map2D != null) { all = map2D.GetIntersections(new FloatRect(0, 0, map2D.Width * map2D.ElementSize, map2D.Height * map2D.ElementSize)); } map2D = new Map2D(width, height, elementSize); foreach (var a in all) { map2D.Put(a); } }