Exemplo n.º 1
0
 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!");
 }
Exemplo n.º 2
0
 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;
         }
     }
 }
Exemplo n.º 3
0
        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);
            }
        }