public void Add(WorldObject o) { if (worldObjects.Contains(o)) { Log.Error(string.Concat("Tried to add world object ", o, " to world, but it's already here.")); return; } if (o.Tile < 0) { Log.Error(string.Concat("Tried to add world object ", o, " but its tile is not set. Setting to 0.")); o.Tile = 0; } worldObjects.Add(o); AddToCache(o); o.SpawnSetup(); o.PostAdd(); }
public void Add(WorldObject o) { if (this.worldObjects.Contains(o)) { Log.Error("Tried to add world object " + o + " to world, but it's already here.", false); return; } if (o.Tile < 0) { Log.Error("Tried to add world object " + o + " but its tile is not set. Setting to 0.", false); o.Tile = 0; } this.worldObjects.Add(o); this.AddToCache(o); o.SpawnSetup(); o.PostAdd(); }