public static void UpdateLocationObjects(this WorldLocation self, List <ObjectDto> objects) { UpdateEntities(objects); self.WorldLocationObjects = objects; WorldData.ObjectsAreChanged = false; LogManager.GetCurrentClassLogger().Info($"Location objects {WorldData.WorldLocationId} was updated in structure!"); }
public static void UpdateWorldLocation(this WorldStructure self, WorldLocation changedLocation) { for (int i = 0; i < self.WorldLocations.Count; i++) { if (self.WorldLocations[i].Id == changedLocation.Id) { self.WorldLocations[i] = changedLocation; } } }
public static void RemoveLocation(this WorldStructure self, WorldLocation deletedLocation) { WorldLocation result = null; foreach (WorldLocation worldLocation in self.WorldLocations) { if (worldLocation.Id == deletedLocation.Id) { result = worldLocation; } } if (result != null) { self.WorldLocations.Remove(result); } }