private void AddShuttle(StationCargoOrderDatabaseComponent component) { Setup(); if (CargoMap == null || component.Shuttle != null) { return; } if (component.CargoShuttleProto != null) { var prototype = _protoMan.Index <CargoShuttlePrototype>(component.CargoShuttleProto); var possibleNames = _protoMan.Index <DatasetPrototype>(prototype.NameDataset).Values; var name = _random.Pick(possibleNames); var(_, gridId) = _loader.LoadBlueprint(CargoMap.Value, prototype.Path.ToString()); var shuttleUid = _mapManager.GetGridEuid(gridId !.Value); var xform = Transform(shuttleUid); MetaData(shuttleUid).EntityName = name; // TODO: Something better like a bounds check. xform.LocalPosition += 100 * _index; var comp = EnsureComp <CargoShuttleComponent>(shuttleUid); comp.Station = component.Owner; comp.Coordinates = xform.Coordinates; component.Shuttle = shuttleUid; comp.NextCall = _timing.CurTime + TimeSpan.FromSeconds(comp.Cooldown); UpdateShuttleCargoConsoles(comp); _index++; _sawmill.Info($"Added cargo shuttle to {ToPrettyString(shuttleUid)}"); } }