private void FillComponents() { this.components.RemoveAll((WorldComponent component) => component == null); foreach (Type item2 in typeof(WorldComponent).AllSubclassesNonAbstract()) { if (this.GetComponent(item2) == null) { WorldComponent item = (WorldComponent)Activator.CreateInstance(item2, this); this.components.Add(item); } } this.tileTemperatures = this.GetComponent <TileTemperaturesComp>(); this.genData = this.GetComponent <WorldGenData>(); }
private void FillComponents() { components.RemoveAll((WorldComponent component) => component == null); foreach (Type item2 in typeof(WorldComponent).AllSubclassesNonAbstract()) { if (GetComponent(item2) == null) { try { WorldComponent item = (WorldComponent)Activator.CreateInstance(item2, this); components.Add(item); } catch (Exception ex) { Log.Error(string.Concat("Could not instantiate a WorldComponent of type ", item2, ": ", ex)); } } } tileTemperatures = GetComponent <TileTemperaturesComp>(); genData = GetComponent <WorldGenData>(); }