static Location Create(IntPtr ptr) { var loc = new Location(ptr); locations[loc.Id] = loc; return loc; }