public PartHandler(CorePart core) { Facing = Direction.N; PartList = new List <Part>(); WeaponGroup = new WeaponGroup(); Bounds = new Rectangle(0, 0, 0, 0); TotalHeatCapacity = 0; Core = core; Add(core); }
public void Remove(Part p) { PartList.Remove(p); if (p.Has <ActivateComponent>()) { WeaponGroup.Remove(p); } // HACK: I don't know a way to fix the bounding box without recalculating it Bounds = CalculateBounds(0, 0, 0, 0); // update heat capacity p.Get <HeatComponent>().MatchSome(comp => TotalHeatCapacity -= comp.HeatCapacity); }