@shipload/sdk 2.0.0-rc23 → 2.0.0-rc25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/shipload.d.ts CHANGED
@@ -1460,11 +1460,9 @@ interface Distance {
1460
1460
  }
1461
1461
  type ItemType = 'resource' | 'component' | 'module' | 'entity';
1462
1462
  type ResourceCategory = 'ore' | 'crystal' | 'gas' | 'regolith' | 'biomass';
1463
- type ResourceTier = 't1' | 't2' | 't3' | 't4' | 't5';
1464
1463
  type ModuleType = 'any' | 'engine' | 'generator' | 'gatherer' | 'loader' | 'warp' | 'crafter' | 'launcher' | 'storage' | 'hauler';
1465
1464
  declare const TIER_ADJECTIVES: Record<number, string>;
1466
1465
  declare const CATEGORY_LABELS: Record<ResourceCategory, string>;
1467
- declare function tierNumber(tier: string): number;
1468
1466
  interface Item {
1469
1467
  id: number;
1470
1468
  name: string;
@@ -2550,6 +2548,26 @@ declare function makeContainer(state: ContainerStateInput): Container;
2550
2548
  declare const itemIds: number[];
2551
2549
  declare function getItem(itemId: UInt16Type): Item;
2552
2550
  declare function getItems(): Item[];
2551
+ declare function getResources(opts?: {
2552
+ category?: ResourceCategory;
2553
+ tier?: number;
2554
+ }): Item[];
2555
+ declare function getComponents(opts?: {
2556
+ tier?: number;
2557
+ }): Item[];
2558
+ declare function getModules(opts?: {
2559
+ moduleType?: ModuleType;
2560
+ tier?: number;
2561
+ }): Item[];
2562
+ declare function getEntityItems(opts?: {
2563
+ tier?: number;
2564
+ }): Item[];
2565
+ declare function resolveItemCategory(id: number): ResourceCategory | undefined;
2566
+ declare function typeLabel(type: ItemType | number): string;
2567
+ declare function categoryLabel(cat: ResourceCategory): string;
2568
+ declare function tierLabel(tier: number): string;
2569
+ declare function categoryFromIndex(i: number): ResourceCategory | undefined;
2570
+ declare function categoryLabelFromIndex(i: number): string;
2553
2571
 
2554
2572
  declare function getLocationType(gameSeed: Checksum256Type, coordinates: CoordinatesType): LocationType;
2555
2573
  declare function isGatherableLocation(locationType: LocationType): boolean;
@@ -2745,8 +2763,8 @@ declare function computeHaulPenalty(totalThrust: number, haulCount: number, avgE
2745
2763
  declare function computeHaulerDrain(distance: number, drain: number, haulCount: number): number;
2746
2764
 
2747
2765
  declare const categoryColors: Record<ResourceCategory, string>;
2748
- declare const tierColors: Record<ResourceTier, string>;
2749
- declare const tierLabels: Record<ResourceTier, string>;
2766
+ declare const tierColors: Record<number, string>;
2767
+ declare const tierLabels: Record<number, string>;
2750
2768
  declare const categoryIcons: Record<ResourceCategory, string>;
2751
2769
  type CategoryIconShape = 'hex' | 'diamond' | 'star' | 'circle' | 'square';
2752
2770
  declare const categoryIconShapes: Record<ResourceCategory, CategoryIconShape>;
@@ -3063,7 +3081,7 @@ declare function formatMassDelta(kg: number): string;
3063
3081
 
3064
3082
  interface DisplayNameInput {
3065
3083
  itemType: 'resource' | 'component' | 'module' | 'entity' | string;
3066
- tier: number | string;
3084
+ tier: number;
3067
3085
  category?: ResourceCategory;
3068
3086
  name: string;
3069
3087
  }
@@ -3124,4 +3142,4 @@ type location_epoch = Types.location_epoch;
3124
3142
  type location_derived = Types.location_derived;
3125
3143
  type location_row = Types.location_row;
3126
3144
 
3127
- export { AckMessage, ActionsManager, AnyEntity, BASE_ORBITAL_MASS, BLEND_INPUTS_MUST_MATCH, BLEND_REQUIRES_MULTIPLE, BLEND_STAT_LESS_NOT_SUPPORTED, BoundingBox, BoundsDeltaMessage, BoundsSubscriptionHandle, CANCEL_CONTAINS_GROUPED_TASK, CANCEL_PAIRED_HAS_PENDING, CATEGORY_LABELS, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, CONTAINER_CAPACITY_EXCEEDED, CONTAINER_NOT_FOUND, CONTAINER_Z, CRAFT_ENERGY_DIVISOR, CRAFT_EXCEEDS_ENERGY_CAPACITY, CRAFT_NOT_ENOUGH_ENERGY, CapabilityAttribute, CapabilityInput, CargoData, CargoMassInfo, CargoStack, CategoryIconShape, CategoryInfo, CategoryStacks, ClientMessage, ConnectionState, Container, ContainerEntity, ContainerStateInput, Coordinates, CoordinatesType, CraftedItemCategory, CrafterCapability, DEPLOY_ENTITY_HAS_SCHEDULE, DEPTH_THRESHOLD_T1, DEPTH_THRESHOLD_T2, DEPTH_THRESHOLD_T3, DEPTH_THRESHOLD_T4, DEPTH_THRESHOLD_T5, DESTINATION_CAPACITY_EXCEEDED, DerivedStratum, DescribeOptions, Distance, ENTITY_CAPACITY_EXCEEDED, ENTITY_NO_CRAFTER, EPOCH_NON_ZERO, EPOCH_NOT_READY, ERROR_SYSTEM_ALREADY_INITIALIZED, ERROR_SYSTEM_DISABLED, ERROR_SYSTEM_NOT_INITIALIZED, EnergyCapability, EntitiesManager, Entity, EntityCapabilities, EntityInfo, EntityInstance, EntityInventory, EntityLayout, EntityRefInput, EntitySlot, EntityState, EntitySubscriptionHandle, EntityType, EntityTypeName, EpochInfo, EpochsManager, ErrorMessage, EstimateTravelTimeOptions, EstimatedTravelTime, EventCatchupCompleteMessage, EventMessage, GAME_NOT_FOUND, GAME_SEED_NOT_SET, GATHER_EXCEEDS_ENERGY_CAPACITY, GATHER_NOT_ENOUGH_ENERGY, GROUP_DUPLICATE_ENTITY, GROUP_EMPTY, GROUP_ENTITY_NOT_MOVABLE, GROUP_HAUL_CAPACITY_EXCEEDED, GROUP_NOT_FOUND, GROUP_NOT_SAME_LOCATION, GROUP_NOT_SAME_OWNER, GROUP_NO_THRUST, GameState, GathererCapability, HasCapacity, HasCargo, HasCargomass, HasScheduleAndLocation, INSUFFICIENT_BALANCE, INSUFFICIENT_ITEM_QUANTITY, INSUFFICIENT_ITEM_SUPPLY, INVALID_AMOUNT, ITEM_BIOMASS_T1, ITEM_BIOMASS_T10, ITEM_BIOMASS_T2, ITEM_BIOMASS_T3, ITEM_BIOMASS_T4, ITEM_BIOMASS_T5, ITEM_BIOMASS_T6, ITEM_BIOMASS_T7, ITEM_BIOMASS_T8, ITEM_BIOMASS_T9, ITEM_CARGO_ARM, ITEM_CARGO_LINING, ITEM_CARGO_LINING_T2, ITEM_CONTAINER_T1_PACKED, ITEM_CONTAINER_T2_PACKED, ITEM_CRAFTER_T1, ITEM_CRYSTAL_T1, ITEM_CRYSTAL_T10, ITEM_CRYSTAL_T2, ITEM_CRYSTAL_T3, ITEM_CRYSTAL_T4, ITEM_CRYSTAL_T5, ITEM_CRYSTAL_T6, ITEM_CRYSTAL_T7, ITEM_CRYSTAL_T8, ITEM_CRYSTAL_T9, ITEM_DOES_NOT_EXIST, ITEM_ENGINE_T1, ITEM_FOCUSING_ARRAY, ITEM_GAS_T1, ITEM_GAS_T10, ITEM_GAS_T2, ITEM_GAS_T3, ITEM_GAS_T4, ITEM_GAS_T5, ITEM_GAS_T6, ITEM_GAS_T7, ITEM_GAS_T8, ITEM_GAS_T9, ITEM_GATHERER_T1, ITEM_GENERATOR_T1, ITEM_HAULER_T1, ITEM_HULL_PLATES, ITEM_HULL_PLATES_T2, ITEM_LOADER_T1, ITEM_MATTER_CONDUIT, ITEM_NOT_AVAILABLE_AT_LOCATION, ITEM_NOT_DEPLOYABLE, ITEM_NOT_PACKED_ENTITY, ITEM_ORE_T1, ITEM_ORE_T10, ITEM_ORE_T2, ITEM_ORE_T3, ITEM_ORE_T4, ITEM_ORE_T5, ITEM_ORE_T6, ITEM_ORE_T7, ITEM_ORE_T8, ITEM_ORE_T9, ITEM_POWER_CELL, ITEM_REACTION_CHAMBER, ITEM_REGOLITH_T1, ITEM_REGOLITH_T10, ITEM_REGOLITH_T2, ITEM_REGOLITH_T3, ITEM_REGOLITH_T4, ITEM_REGOLITH_T5, ITEM_REGOLITH_T6, ITEM_REGOLITH_T7, ITEM_REGOLITH_T8, ITEM_REGOLITH_T9, ITEM_SHIP_T1_PACKED, ITEM_STORAGE_T1, ITEM_SURVEY_PROBE, ITEM_THRUSTER_CORE, ITEM_TOOL_BIT, ITEM_TYPE_COMPONENT, ITEM_TYPE_ENTITY, ITEM_TYPE_MODULE, ITEM_TYPE_RESOURCE, ITEM_WAREHOUSE_T1_PACKED, InventoryAccessor, Item, ItemType, LOCATION_MAX_DEPTH, LOCATION_MIN_DEPTH, LoadTimeBreakdown, LoaderCapability, Location, LocationType, LocationsManager, MAX_ORBITAL_ALTITUDE, MIN_ORBITAL_ALTITUDE, MODULE_ANY, MODULE_CARGO_NOT_FOUND, MODULE_CRAFTER, MODULE_ENGINE, MODULE_ENTITY_BUSY, MODULE_GATHERER, MODULE_GENERATOR, MODULE_HAULER, MODULE_LAUNCHER, MODULE_LOADER, MODULE_NOT_MODULE, MODULE_SLOT_EMPTY, MODULE_SLOT_INVALID, MODULE_SLOT_OCCUPIED, MODULE_STORAGE, MODULE_TYPE_MISMATCH, MODULE_WARP, MassCapability, ModuleDescription, ModuleEntry, ModuleType, MovementCapability, index as NFT, NFTCargoItem, NFTCommonBase, NFTInstalledModule, NFTModuleSlot, NO_SCHEDULE, NamedStats, PLANET_SUBTYPE_GAS_GIANT, PLANET_SUBTYPE_ICY, PLANET_SUBTYPE_INDUSTRIAL, PLANET_SUBTYPE_OCEAN, PLANET_SUBTYPE_ROCKY, PLANET_SUBTYPE_TERRESTRIAL, PLAYER_ALREADY_JOINED, PLAYER_NOT_FOUND, PLAYER_NOT_JOINED, PRECISION, PackedModule, PackedModuleInput, PingMessage, PlanetSubtypeInfo, platform as PlatformContract, Player, PlayerStateInput, PlayersManager, PongMessage, Projectable, ProjectableSnapshot, ProjectedEntity, ProjectionOptions, RECIPE_INPUTS_EXCESS, RECIPE_INPUTS_INSUFFICIENT, RECIPE_INPUTS_INVALID, RECIPE_INPUTS_MIXED, RECIPE_NOT_FOUND, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, RESERVE_TIERS, RESOLVE_COUNT_EXCEEDS_COMPLETED, Recipe, RecipeInput, RecipeInputCategory, RecipeInputItemId, RecipeSlotInput, RenderDescriptionOptions, ReserveTier, ResolvedAttributeGroup, ResolvedItem, ResolvedItemStat, ResolvedItemType, ResolvedModuleSlot, ResourceCategory, ResourceStats, ResourceTier, SHIP_ALREADY_THERE, SHIP_ALREADY_TRAVELING, SHIP_CANNOT_BUY_TRAVELING, SHIP_CANNOT_CANCEL_TASK, SHIP_CANNOT_UPDATE_TRAVELING, SHIP_CAPACITY_EXCEEDED, SHIP_CARGO_NOT_LOADED, SHIP_CARGO_NOT_OWNED, SHIP_INVALID_CARGO, SHIP_INVALID_DESTINATION, SHIP_INVALID_TRAVEL_DURATION, SHIP_NOT_ARRIVED, SHIP_NOT_ENOUGH_ENERGY, SHIP_NOT_ENOUGH_ENERGY_CAPACITY, SHIP_NOT_FOUND, SHIP_NOT_IDLE, SHIP_NOT_OWNED, SHIP_NO_COMPLETED_TASKS, SHIP_NO_TASKS_TO_CANCEL, STARTER_ALREADY_CLAIMED, ScheduleAccessor, ScheduleCapability, ScheduleData, Scheduleable, server as ServerContract, ServerMessage, Ship, ShipCapabilities, ShipEntity, ShipLike, ShipStateInput, Shipload, SnapshotMessage, StackInput, StatDefinition, StatMapping, StatSlot, StorageCapability, StratumInfo, SubscribeEntityMessage, SubscribeEventsMessage, SubscribeMessage, SubscriptionEntityType, SubscriptionsManager, SubscriptionsOptions, TIER_ADJECTIVES, TIER_ROLL_MAX, TRAVEL_MAX_DURATION, TaskCancelable, TaskType, TextSpan, TierRange, TransferEntity, UnsubscribeEntityMessage, UnsubscribeEventsMessage, UnsubscribeMessage, UpdateBoundsMessage, UpdateMessage, WAREHOUSE_ALREADY_AT_LOCATION, WAREHOUSE_CAPACITY_EXCEEDED, WAREHOUSE_NOT_FOUND, WAREHOUSE_Z, WARP_HAS_CARGO, WARP_HAS_SCHEDULE, WARP_NOT_FULL_ENERGY, WARP_NO_CAPABILITY, WARP_OUT_OF_RANGE, Warehouse, WarehouseEntity, WarehouseStateInput, WebSocketConnection, WebSocketConnectionOptions, WireCoordinates, WireEntity, availableCapacity$1 as availableCapacity, availableCapacityFromMass, blendCargoStacks, blendComponentStacks, blendCrossGroup, blendStacks, buildEntityDescription, calcCargoItemMass, calcCargoMass, calcEnergyUsage, calcLoadDuration, calcStacksMass, calc_acceleration, calc_craft_duration, calc_craft_energy, calc_energyusage, calc_flighttime, calc_gather_duration, calc_gather_energy, calc_loader_acceleration, calc_loader_flighttime, calc_orbital_altitude, calc_rechargetime, calc_ship_acceleration, calc_ship_flighttime, calc_ship_mass, calc_ship_rechargetime, calc_transfer_duration, calculateFlightTime, calculateLoadTimeBreakdown, calculateRefuelingTime, calculateTransferTime, canMove, capabilityAttributes, capabilityNames, capsHasCrafter, capsHasGatherer, capsHasHauler, capsHasLoaders, capsHasMass, capsHasMovement, capsHasStorage, cargoItemToStack, cargoUtils, cargo_item, categoryColors, categoryIconShapes, categoryIcons, componentIcon, computeBaseCapacityShip, computeBaseCapacityWarehouse, computeBaseHullmass, computeComponentStats, computeContainerCapabilities, computeContainerT2Capabilities, computeCraftedOutputStats, computeCrafterCapabilities, computeCrafterDrain, computeCrafterSpeed, computeEngineCapabilities, computeEngineDrain, computeEngineThrust, computeEntityStats, computeGathererCapabilities, computeGathererDepth, computeGathererDrain, computeGathererSpeed, computeGathererYield, computeGeneratorCap, computeGeneratorCapabilities, computeGeneratorRech, computeHaulPenalty, computeHaulerCapabilities, computeHaulerDrain, computeInputMass, computeLoaderCapabilities, computeLoaderMass, computeLoaderThrust, computeShipCapabilities, computeShipHullCapabilities, computeStorageCapabilities, computeWarehouseCapabilities, computeWarehouseHullCapabilities, container_row, coordsToLocationId, createInventoryAccessor, createProjectedEntity, createScheduleAccessor, decodeCraftedItemStats, decodeStat, decodeStats, Shipload as default, deriveLocation, deriveLocationEpoch, deriveLocationSize, deriveLocationStatic, deriveResourceStats, deriveStrata, deriveStratum, describeItem, describeModule, describeModuleForItem, describeModuleForSlot, deserializeAsset, deserializeComponent, deserializeEntity, deserializeModule, deserializeResource, displayName, distanceBetweenCoordinates, distanceBetweenPoints, encodeGatheredCargoStats, encodeStats, energyPercent, energy_stats, entityDisplayName, estimateDealTravelTime, estimateTravelTime, findItemByCategoryAndTier, findNearbyPlanets, formatMass, formatMassDelta, formatModuleLine, formatTier, gatherer_stats, getCapabilityAttributes, getCategoryInfo, getCurrentEpoch, getDepthThreshold, getDestinationLocation, getEligibleResources, getEntityLayout, getEpochInfo, getFlightOrigin, getItem, getItems, getLocationCandidates, getLocationType, getLocationTypeName, getModuleCapabilityType, getPlanetSubtype, getPlanetSubtypes, getPositionAt, getRecipe, getResourceTier, getResourceWeight, getStatDefinitions, getStatMappings, getStatMappingsForCapability, getStatMappingsForStat, getStatName, getSystemName, hasEnergy, hasEnergyForDistance, hasGatherer, hasLoaders, hasMass, hasSchedule, hasSpace$1 as hasSpace, hasSpaceForMass, hasStorage, hasSystem, hash, hash512, isCraftedItem, isFull$1 as isFull, isFullFromMass, isGatherableLocation, isInvertedAttribute, isModuleItem, isRelatedItem, isSubscriptionsDebugEnabled, itemAbbreviations, itemCategory, itemIds, itemOffset, itemTier, itemTypeCode, lerp, loader_stats, location_derived, location_epoch, location_row, location_static, makeContainer, makeShip, makeWarehouse, mapEntity, maxTravelDistance, mergeStacks, moduleAccepts, moduleDisplayName, moduleIcon, moduleSlotTypeToCode, movement_stats, needsRecharge, parseWireEntity, projectEntity, projectEntityAt, projectFromCurrentState, projectFromCurrentStateAt, readCommonBase, removeFromStacks, renderDescription, resolveItem, resolveStats, rollTier, rollWithinTier, rotation, schedule, setSubscriptionsDebug, stackKey, stackToCargoItem, stacksEqual, statMappings, task, tierColors, tierLabels, tierNumber, toLocation, validateSchedule, warehouse_row };
3145
+ export { AckMessage, ActionsManager, AnyEntity, BASE_ORBITAL_MASS, BLEND_INPUTS_MUST_MATCH, BLEND_REQUIRES_MULTIPLE, BLEND_STAT_LESS_NOT_SUPPORTED, BoundingBox, BoundsDeltaMessage, BoundsSubscriptionHandle, CANCEL_CONTAINS_GROUPED_TASK, CANCEL_PAIRED_HAS_PENDING, CATEGORY_LABELS, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, CONTAINER_CAPACITY_EXCEEDED, CONTAINER_NOT_FOUND, CONTAINER_Z, CRAFT_ENERGY_DIVISOR, CRAFT_EXCEEDS_ENERGY_CAPACITY, CRAFT_NOT_ENOUGH_ENERGY, CapabilityAttribute, CapabilityInput, CargoData, CargoMassInfo, CargoStack, CategoryIconShape, CategoryInfo, CategoryStacks, ClientMessage, ConnectionState, Container, ContainerEntity, ContainerStateInput, Coordinates, CoordinatesType, CraftedItemCategory, CrafterCapability, DEPLOY_ENTITY_HAS_SCHEDULE, DEPTH_THRESHOLD_T1, DEPTH_THRESHOLD_T2, DEPTH_THRESHOLD_T3, DEPTH_THRESHOLD_T4, DEPTH_THRESHOLD_T5, DESTINATION_CAPACITY_EXCEEDED, DerivedStratum, DescribeOptions, Distance, ENTITY_CAPACITY_EXCEEDED, ENTITY_NO_CRAFTER, EPOCH_NON_ZERO, EPOCH_NOT_READY, ERROR_SYSTEM_ALREADY_INITIALIZED, ERROR_SYSTEM_DISABLED, ERROR_SYSTEM_NOT_INITIALIZED, EnergyCapability, EntitiesManager, Entity, EntityCapabilities, EntityInfo, EntityInstance, EntityInventory, EntityLayout, EntityRefInput, EntitySlot, EntityState, EntitySubscriptionHandle, EntityType, EntityTypeName, EpochInfo, EpochsManager, ErrorMessage, EstimateTravelTimeOptions, EstimatedTravelTime, EventCatchupCompleteMessage, EventMessage, GAME_NOT_FOUND, GAME_SEED_NOT_SET, GATHER_EXCEEDS_ENERGY_CAPACITY, GATHER_NOT_ENOUGH_ENERGY, GROUP_DUPLICATE_ENTITY, GROUP_EMPTY, GROUP_ENTITY_NOT_MOVABLE, GROUP_HAUL_CAPACITY_EXCEEDED, GROUP_NOT_FOUND, GROUP_NOT_SAME_LOCATION, GROUP_NOT_SAME_OWNER, GROUP_NO_THRUST, GameState, GathererCapability, HasCapacity, HasCargo, HasCargomass, HasScheduleAndLocation, INSUFFICIENT_BALANCE, INSUFFICIENT_ITEM_QUANTITY, INSUFFICIENT_ITEM_SUPPLY, INVALID_AMOUNT, ITEM_BIOMASS_T1, ITEM_BIOMASS_T10, ITEM_BIOMASS_T2, ITEM_BIOMASS_T3, ITEM_BIOMASS_T4, ITEM_BIOMASS_T5, ITEM_BIOMASS_T6, ITEM_BIOMASS_T7, ITEM_BIOMASS_T8, ITEM_BIOMASS_T9, ITEM_CARGO_ARM, ITEM_CARGO_LINING, ITEM_CARGO_LINING_T2, ITEM_CONTAINER_T1_PACKED, ITEM_CONTAINER_T2_PACKED, ITEM_CRAFTER_T1, ITEM_CRYSTAL_T1, ITEM_CRYSTAL_T10, ITEM_CRYSTAL_T2, ITEM_CRYSTAL_T3, ITEM_CRYSTAL_T4, ITEM_CRYSTAL_T5, ITEM_CRYSTAL_T6, ITEM_CRYSTAL_T7, ITEM_CRYSTAL_T8, ITEM_CRYSTAL_T9, ITEM_DOES_NOT_EXIST, ITEM_ENGINE_T1, ITEM_FOCUSING_ARRAY, ITEM_GAS_T1, ITEM_GAS_T10, ITEM_GAS_T2, ITEM_GAS_T3, ITEM_GAS_T4, ITEM_GAS_T5, ITEM_GAS_T6, ITEM_GAS_T7, ITEM_GAS_T8, ITEM_GAS_T9, ITEM_GATHERER_T1, ITEM_GENERATOR_T1, ITEM_HAULER_T1, ITEM_HULL_PLATES, ITEM_HULL_PLATES_T2, ITEM_LOADER_T1, ITEM_MATTER_CONDUIT, ITEM_NOT_AVAILABLE_AT_LOCATION, ITEM_NOT_DEPLOYABLE, ITEM_NOT_PACKED_ENTITY, ITEM_ORE_T1, ITEM_ORE_T10, ITEM_ORE_T2, ITEM_ORE_T3, ITEM_ORE_T4, ITEM_ORE_T5, ITEM_ORE_T6, ITEM_ORE_T7, ITEM_ORE_T8, ITEM_ORE_T9, ITEM_POWER_CELL, ITEM_REACTION_CHAMBER, ITEM_REGOLITH_T1, ITEM_REGOLITH_T10, ITEM_REGOLITH_T2, ITEM_REGOLITH_T3, ITEM_REGOLITH_T4, ITEM_REGOLITH_T5, ITEM_REGOLITH_T6, ITEM_REGOLITH_T7, ITEM_REGOLITH_T8, ITEM_REGOLITH_T9, ITEM_SHIP_T1_PACKED, ITEM_STORAGE_T1, ITEM_SURVEY_PROBE, ITEM_THRUSTER_CORE, ITEM_TOOL_BIT, ITEM_TYPE_COMPONENT, ITEM_TYPE_ENTITY, ITEM_TYPE_MODULE, ITEM_TYPE_RESOURCE, ITEM_WAREHOUSE_T1_PACKED, InventoryAccessor, Item, ItemType, LOCATION_MAX_DEPTH, LOCATION_MIN_DEPTH, LoadTimeBreakdown, LoaderCapability, Location, LocationStratum, LocationType, LocationsManager, MAX_ORBITAL_ALTITUDE, MIN_ORBITAL_ALTITUDE, MODULE_ANY, MODULE_CARGO_NOT_FOUND, MODULE_CRAFTER, MODULE_ENGINE, MODULE_ENTITY_BUSY, MODULE_GATHERER, MODULE_GENERATOR, MODULE_HAULER, MODULE_LAUNCHER, MODULE_LOADER, MODULE_NOT_MODULE, MODULE_SLOT_EMPTY, MODULE_SLOT_INVALID, MODULE_SLOT_OCCUPIED, MODULE_STORAGE, MODULE_TYPE_MISMATCH, MODULE_WARP, MassCapability, ModuleDescription, ModuleEntry, ModuleType, MovementCapability, index as NFT, NFTCargoItem, NFTCommonBase, NFTInstalledModule, NFTModuleSlot, NO_SCHEDULE, NamedStats, PLANET_SUBTYPE_GAS_GIANT, PLANET_SUBTYPE_ICY, PLANET_SUBTYPE_INDUSTRIAL, PLANET_SUBTYPE_OCEAN, PLANET_SUBTYPE_ROCKY, PLANET_SUBTYPE_TERRESTRIAL, PLAYER_ALREADY_JOINED, PLAYER_NOT_FOUND, PLAYER_NOT_JOINED, PRECISION, PackedModule, PackedModuleInput, PingMessage, PlanetSubtypeInfo, platform as PlatformContract, Player, PlayerStateInput, PlayersManager, PongMessage, Projectable, ProjectableSnapshot, ProjectedEntity, ProjectionOptions, RECIPE_INPUTS_EXCESS, RECIPE_INPUTS_INSUFFICIENT, RECIPE_INPUTS_INVALID, RECIPE_INPUTS_MIXED, RECIPE_NOT_FOUND, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, RESERVE_TIERS, RESOLVE_COUNT_EXCEEDS_COMPLETED, Recipe, RecipeInput, RecipeInputCategory, RecipeInputItemId, RecipeSlotInput, RenderDescriptionOptions, ReserveTier, ResolvedAttributeGroup, ResolvedItem, ResolvedItemStat, ResolvedItemType, ResolvedModuleSlot, ResourceCategory, ResourceStats, SHIP_ALREADY_THERE, SHIP_ALREADY_TRAVELING, SHIP_CANNOT_BUY_TRAVELING, SHIP_CANNOT_CANCEL_TASK, SHIP_CANNOT_UPDATE_TRAVELING, SHIP_CAPACITY_EXCEEDED, SHIP_CARGO_NOT_LOADED, SHIP_CARGO_NOT_OWNED, SHIP_INVALID_CARGO, SHIP_INVALID_DESTINATION, SHIP_INVALID_TRAVEL_DURATION, SHIP_NOT_ARRIVED, SHIP_NOT_ENOUGH_ENERGY, SHIP_NOT_ENOUGH_ENERGY_CAPACITY, SHIP_NOT_FOUND, SHIP_NOT_IDLE, SHIP_NOT_OWNED, SHIP_NO_COMPLETED_TASKS, SHIP_NO_TASKS_TO_CANCEL, STARTER_ALREADY_CLAIMED, ScheduleAccessor, ScheduleCapability, ScheduleData, Scheduleable, server as ServerContract, ServerMessage, Ship, ShipCapabilities, ShipEntity, ShipLike, ShipStateInput, Shipload, SnapshotMessage, StackInput, StatDefinition, StatMapping, StatSlot, StorageCapability, StratumInfo, SubscribeEntityMessage, SubscribeEventsMessage, SubscribeMessage, SubscriptionEntityType, SubscriptionsManager, SubscriptionsOptions, TIER_ADJECTIVES, TIER_ROLL_MAX, TRAVEL_MAX_DURATION, TaskCancelable, TaskType, TextSpan, TierRange, TransferEntity, UnsubscribeEntityMessage, UnsubscribeEventsMessage, UnsubscribeMessage, UpdateBoundsMessage, UpdateMessage, WAREHOUSE_ALREADY_AT_LOCATION, WAREHOUSE_CAPACITY_EXCEEDED, WAREHOUSE_NOT_FOUND, WAREHOUSE_Z, WARP_HAS_CARGO, WARP_HAS_SCHEDULE, WARP_NOT_FULL_ENERGY, WARP_NO_CAPABILITY, WARP_OUT_OF_RANGE, Warehouse, WarehouseEntity, WarehouseStateInput, WebSocketConnection, WebSocketConnectionOptions, WireCoordinates, WireEntity, availableCapacity$1 as availableCapacity, availableCapacityFromMass, blendCargoStacks, blendComponentStacks, blendCrossGroup, blendStacks, buildEntityDescription, calcCargoItemMass, calcCargoMass, calcEnergyUsage, calcLoadDuration, calcStacksMass, calc_acceleration, calc_craft_duration, calc_craft_energy, calc_energyusage, calc_flighttime, calc_gather_duration, calc_gather_energy, calc_loader_acceleration, calc_loader_flighttime, calc_orbital_altitude, calc_rechargetime, calc_ship_acceleration, calc_ship_flighttime, calc_ship_mass, calc_ship_rechargetime, calc_transfer_duration, calculateFlightTime, calculateLoadTimeBreakdown, calculateRefuelingTime, calculateTransferTime, canMove, capabilityAttributes, capabilityNames, capsHasCrafter, capsHasGatherer, capsHasHauler, capsHasLoaders, capsHasMass, capsHasMovement, capsHasStorage, cargoItemToStack, cargoUtils, cargo_item, categoryColors, categoryFromIndex, categoryIconShapes, categoryIcons, categoryLabel, categoryLabelFromIndex, componentIcon, computeBaseCapacityShip, computeBaseCapacityWarehouse, computeBaseHullmass, computeComponentStats, computeContainerCapabilities, computeContainerT2Capabilities, computeCraftedOutputStats, computeCrafterCapabilities, computeCrafterDrain, computeCrafterSpeed, computeEngineCapabilities, computeEngineDrain, computeEngineThrust, computeEntityStats, computeGathererCapabilities, computeGathererDepth, computeGathererDrain, computeGathererSpeed, computeGathererYield, computeGeneratorCap, computeGeneratorCapabilities, computeGeneratorRech, computeHaulPenalty, computeHaulerCapabilities, computeHaulerDrain, computeInputMass, computeLoaderCapabilities, computeLoaderMass, computeLoaderThrust, computeShipCapabilities, computeShipHullCapabilities, computeStorageCapabilities, computeWarehouseCapabilities, computeWarehouseHullCapabilities, container_row, coordsToLocationId, createInventoryAccessor, createProjectedEntity, createScheduleAccessor, decodeCraftedItemStats, decodeStat, decodeStats, Shipload as default, deriveLocation, deriveLocationEpoch, deriveLocationSize, deriveLocationStatic, deriveResourceStats, deriveStrata, deriveStratum, describeItem, describeModule, describeModuleForItem, describeModuleForSlot, deserializeAsset, deserializeComponent, deserializeEntity, deserializeModule, deserializeResource, displayName, distanceBetweenCoordinates, distanceBetweenPoints, encodeGatheredCargoStats, encodeStats, energyPercent, energy_stats, entityDisplayName, estimateDealTravelTime, estimateTravelTime, findItemByCategoryAndTier, findNearbyPlanets, formatMass, formatMassDelta, formatModuleLine, formatTier, gatherer_stats, getCapabilityAttributes, getCategoryInfo, getComponents, getCurrentEpoch, getDepthThreshold, getDestinationLocation, getEligibleResources, getEntityItems, getEntityLayout, getEpochInfo, getFlightOrigin, getItem, getItems, getLocationCandidates, getLocationType, getLocationTypeName, getModuleCapabilityType, getModules, getPlanetSubtype, getPlanetSubtypes, getPositionAt, getRecipe, getResourceTier, getResourceWeight, getResources, getStatDefinitions, getStatMappings, getStatMappingsForCapability, getStatMappingsForStat, getStatName, getSystemName, hasEnergy, hasEnergyForDistance, hasGatherer, hasLoaders, hasMass, hasSchedule, hasSpace$1 as hasSpace, hasSpaceForMass, hasStorage, hasSystem, hash, hash512, isCraftedItem, isFull$1 as isFull, isFullFromMass, isGatherableLocation, isInvertedAttribute, isModuleItem, isRelatedItem, isSubscriptionsDebugEnabled, itemAbbreviations, itemCategory, itemIds, itemOffset, itemTier, itemTypeCode, lerp, loader_stats, location_derived, location_epoch, location_row, location_static, makeContainer, makeShip, makeWarehouse, mapEntity, maxTravelDistance, mergeStacks, moduleAccepts, moduleDisplayName, moduleIcon, moduleSlotTypeToCode, movement_stats, needsRecharge, parseWireEntity, projectEntity, projectEntityAt, projectFromCurrentState, projectFromCurrentStateAt, readCommonBase, removeFromStacks, renderDescription, resolveItem, resolveItemCategory, resolveStats, rollTier, rollWithinTier, rotation, schedule, setSubscriptionsDebug, stackKey, stackToCargoItem, stacksEqual, statMappings, task, tierColors, tierLabel, tierLabels, toLocation, typeLabel, validateSchedule, warehouse_row };
package/lib/shipload.js CHANGED
@@ -2416,9 +2416,6 @@ const CATEGORY_LABELS = {
2416
2416
  regolith: 'Regolith',
2417
2417
  biomass: 'Biomass',
2418
2418
  };
2419
- function tierNumber(tier) {
2420
- return Number(String(tier).replace(/^t/i, ''));
2421
- }
2422
2419
  function formatTier(tier) {
2423
2420
  return 'T' + tier;
2424
2421
  }
@@ -3703,6 +3700,78 @@ var entities = [
3703
3700
  }
3704
3701
  ];
3705
3702
 
3703
+ const categoryColors = {
3704
+ ore: '#C26D3F',
3705
+ crystal: '#4ADBFF',
3706
+ gas: '#B8E4A0',
3707
+ regolith: '#C4A57B',
3708
+ biomass: '#5A8B3E',
3709
+ };
3710
+ const tierColors = {
3711
+ 1: '#8b8b8b',
3712
+ 2: '#4ade80',
3713
+ 3: '#818cf8',
3714
+ 4: '#c084fc',
3715
+ 5: '#fbbf24',
3716
+ 6: '#f97316',
3717
+ 7: '#ef4444',
3718
+ 8: '#ec4899',
3719
+ 9: '#06b6d4',
3720
+ 10: '#ffffff',
3721
+ };
3722
+ const tierLabels = {
3723
+ 1: 'Common',
3724
+ 2: 'Uncommon',
3725
+ 3: 'Rare',
3726
+ 4: 'Epic',
3727
+ 5: 'Legendary',
3728
+ 6: 'Mythic',
3729
+ 7: 'Divine',
3730
+ 8: 'Celestial',
3731
+ 9: 'Eternal',
3732
+ 10: 'Transcendent',
3733
+ };
3734
+ const categoryIcons = {
3735
+ ore: '⬡',
3736
+ crystal: '◈',
3737
+ gas: '◎',
3738
+ regolith: '■',
3739
+ biomass: '❋',
3740
+ };
3741
+ const categoryIconShapes = {
3742
+ ore: 'hex',
3743
+ crystal: 'diamond',
3744
+ gas: 'circle',
3745
+ regolith: 'square',
3746
+ biomass: 'star',
3747
+ };
3748
+ const componentIcon = '▣';
3749
+ const moduleIcon = '⬢';
3750
+ const itemAbbreviations = {
3751
+ 10001: 'HP',
3752
+ 10002: 'CL',
3753
+ 10003: 'TC',
3754
+ 10004: 'PC',
3755
+ 10005: 'DS',
3756
+ 10006: 'EP',
3757
+ 10007: 'CA',
3758
+ 10008: 'TB',
3759
+ 10009: 'RC',
3760
+ 10010: 'FA',
3761
+ 10100: 'EN',
3762
+ 10101: 'GN',
3763
+ 10102: 'EX',
3764
+ 10103: 'LD',
3765
+ 10104: 'MF',
3766
+ 10105: 'ST',
3767
+ 10200: 'CT',
3768
+ 10201: 'SH',
3769
+ 10202: 'WH',
3770
+ 20001: 'HP',
3771
+ 20002: 'CL',
3772
+ 20200: 'CT',
3773
+ };
3774
+
3706
3775
  const itemMetadata = {
3707
3776
  101: { name: 'Ore', description: 'Crude metallic ore.', color: '#C26D3F' },
3708
3777
  102: { name: 'Ore', description: 'Refined metallic ore with improved purity.', color: '#C26D3F' },
@@ -3910,6 +3979,86 @@ function getItem(itemId) {
3910
3979
  function getItems() {
3911
3980
  return Array.from(itemsById.values());
3912
3981
  }
3982
+ function getResources(opts) {
3983
+ const out = [];
3984
+ for (const item of itemsById.values()) {
3985
+ if (item.type !== 'resource')
3986
+ continue;
3987
+ if (opts?.category !== undefined && item.category !== opts.category)
3988
+ continue;
3989
+ if (opts?.tier !== undefined && item.tier !== opts.tier)
3990
+ continue;
3991
+ out.push(item);
3992
+ }
3993
+ return out;
3994
+ }
3995
+ function getComponents(opts) {
3996
+ const out = [];
3997
+ for (const item of itemsById.values()) {
3998
+ if (item.type !== 'component')
3999
+ continue;
4000
+ if (opts?.tier !== undefined && item.tier !== opts.tier)
4001
+ continue;
4002
+ out.push(item);
4003
+ }
4004
+ return out;
4005
+ }
4006
+ function getModules(opts) {
4007
+ const out = [];
4008
+ for (const item of itemsById.values()) {
4009
+ if (item.type !== 'module')
4010
+ continue;
4011
+ if (opts?.moduleType !== undefined && item.moduleType !== opts.moduleType)
4012
+ continue;
4013
+ if (opts?.tier !== undefined && item.tier !== opts.tier)
4014
+ continue;
4015
+ out.push(item);
4016
+ }
4017
+ return out;
4018
+ }
4019
+ function getEntityItems(opts) {
4020
+ const out = [];
4021
+ for (const item of itemsById.values()) {
4022
+ if (item.type !== 'entity')
4023
+ continue;
4024
+ if (opts?.tier !== undefined && item.tier !== opts.tier)
4025
+ continue;
4026
+ out.push(item);
4027
+ }
4028
+ return out;
4029
+ }
4030
+ function resolveItemCategory(id) {
4031
+ const item = itemsById.get(id);
4032
+ return item?.category;
4033
+ }
4034
+ const TYPE_LABEL_BY_STRING = {
4035
+ resource: 'Resource',
4036
+ component: 'Component',
4037
+ module: 'Module',
4038
+ entity: 'Entity',
4039
+ };
4040
+ const TYPE_BY_INDEX = ['resource', 'component', 'module', 'entity'];
4041
+ function typeLabel(type) {
4042
+ if (typeof type === 'number') {
4043
+ const t = TYPE_BY_INDEX[type];
4044
+ return t ? TYPE_LABEL_BY_STRING[t] : `type ${type}`;
4045
+ }
4046
+ return TYPE_LABEL_BY_STRING[type] ?? `type ${type}`;
4047
+ }
4048
+ function categoryLabel(cat) {
4049
+ return CATEGORY_LABELS[cat];
4050
+ }
4051
+ function tierLabel(tier) {
4052
+ return tierLabels[tier] ?? `T${tier}`;
4053
+ }
4054
+ const CATEGORY_BY_INDEX = ['ore', 'gas', 'regolith', 'biomass', 'crystal'];
4055
+ function categoryFromIndex(i) {
4056
+ return CATEGORY_BY_INDEX[i];
4057
+ }
4058
+ function categoryLabelFromIndex(i) {
4059
+ const cat = categoryFromIndex(i);
4060
+ return cat ? CATEGORY_LABELS[cat] : `category ${i}`;
4061
+ }
3913
4062
 
3914
4063
  const recipesById = new Map();
3915
4064
  for (const r of recipes)
@@ -9681,68 +9830,6 @@ function computeHaulerDrain(distance, drain, haulCount) {
9681
9830
  return Math.floor(distance / PRECISION) * drain * haulCount;
9682
9831
  }
9683
9832
 
9684
- const categoryColors = {
9685
- ore: '#C26D3F',
9686
- crystal: '#4ADBFF',
9687
- gas: '#B8E4A0',
9688
- regolith: '#C4A57B',
9689
- biomass: '#5A8B3E',
9690
- };
9691
- const tierColors = {
9692
- t1: '#8b8b8b',
9693
- t2: '#4ade80',
9694
- t3: '#818cf8',
9695
- t4: '#c084fc',
9696
- t5: '#fbbf24',
9697
- };
9698
- const tierLabels = {
9699
- t1: 'Common',
9700
- t2: 'Uncommon',
9701
- t3: 'Rare',
9702
- t4: 'Epic',
9703
- t5: 'Legendary',
9704
- };
9705
- const categoryIcons = {
9706
- ore: '⬡',
9707
- crystal: '◈',
9708
- gas: '◎',
9709
- regolith: '■',
9710
- biomass: '❋',
9711
- };
9712
- const categoryIconShapes = {
9713
- ore: 'hex',
9714
- crystal: 'diamond',
9715
- gas: 'circle',
9716
- regolith: 'square',
9717
- biomass: 'star',
9718
- };
9719
- const componentIcon = '▣';
9720
- const moduleIcon = '⬢';
9721
- const itemAbbreviations = {
9722
- 10001: 'HP',
9723
- 10002: 'CL',
9724
- 10003: 'TC',
9725
- 10004: 'PC',
9726
- 10005: 'DS',
9727
- 10006: 'EP',
9728
- 10007: 'CA',
9729
- 10008: 'TB',
9730
- 10009: 'RC',
9731
- 10010: 'FA',
9732
- 10100: 'EN',
9733
- 10101: 'GN',
9734
- 10102: 'EX',
9735
- 10103: 'LD',
9736
- 10104: 'MF',
9737
- 10105: 'ST',
9738
- 10200: 'CT',
9739
- 10201: 'SH',
9740
- 10202: 'WH',
9741
- 20001: 'HP',
9742
- 20002: 'CL',
9743
- 20200: 'CT',
9744
- };
9745
-
9746
9833
  const ITEM_TYPE_RESOURCE = 0;
9747
9834
  const ITEM_TYPE_COMPONENT = 1;
9748
9835
  const ITEM_TYPE_MODULE = 2;
@@ -10862,12 +10949,9 @@ function formatMassDelta(kg) {
10862
10949
  return `${sign}${formatMass(Math.abs(kg))}`;
10863
10950
  }
10864
10951
 
10865
- function asTierNumber(tier) {
10866
- return typeof tier === 'number' ? tier : tierNumber(tier);
10867
- }
10868
10952
  function displayName(resolved) {
10869
10953
  if (resolved.itemType === 'resource') {
10870
- const adj = TIER_ADJECTIVES[asTierNumber(resolved.tier)] ?? 'Unknown';
10954
+ const adj = TIER_ADJECTIVES[resolved.tier] ?? 'Unknown';
10871
10955
  const cat = resolved.category ? CATEGORY_LABELS[resolved.category] : 'Resource';
10872
10956
  return `${adj} ${cat}`;
10873
10957
  }
@@ -10876,7 +10960,7 @@ function displayName(resolved) {
10876
10960
  function describeItem(resolved, opts) {
10877
10961
  const massFmt = opts?.formatMass ?? formatMass;
10878
10962
  const mass = massFmt(resolved.mass);
10879
- const tier = `T${asTierNumber(resolved.tier)}`;
10963
+ const tier = `T${resolved.tier}`;
10880
10964
  if (resolved.itemType === 'resource') {
10881
10965
  const cat = resolved.category ? CATEGORY_LABELS[resolved.category] : 'Resource';
10882
10966
  const header = `${tier} ${cat}`;
@@ -11154,8 +11238,11 @@ exports.capsHasStorage = capsHasStorage;
11154
11238
  exports.cargoItemToStack = cargoItemToStack;
11155
11239
  exports.cargoUtils = cargoUtils;
11156
11240
  exports.categoryColors = categoryColors;
11241
+ exports.categoryFromIndex = categoryFromIndex;
11157
11242
  exports.categoryIconShapes = categoryIconShapes;
11158
11243
  exports.categoryIcons = categoryIcons;
11244
+ exports.categoryLabel = categoryLabel;
11245
+ exports.categoryLabelFromIndex = categoryLabelFromIndex;
11159
11246
  exports.componentIcon = componentIcon;
11160
11247
  exports.computeBaseCapacityShip = computeBaseCapacityShip;
11161
11248
  exports.computeBaseCapacityWarehouse = computeBaseCapacityWarehouse;
@@ -11232,10 +11319,12 @@ exports.formatModuleLine = formatModuleLine;
11232
11319
  exports.formatTier = formatTier;
11233
11320
  exports.getCapabilityAttributes = getCapabilityAttributes;
11234
11321
  exports.getCategoryInfo = getCategoryInfo;
11322
+ exports.getComponents = getComponents;
11235
11323
  exports.getCurrentEpoch = getCurrentEpoch;
11236
11324
  exports.getDepthThreshold = getDepthThreshold;
11237
11325
  exports.getDestinationLocation = getDestinationLocation;
11238
11326
  exports.getEligibleResources = getEligibleResources;
11327
+ exports.getEntityItems = getEntityItems;
11239
11328
  exports.getEntityLayout = getEntityLayout;
11240
11329
  exports.getEpochInfo = getEpochInfo;
11241
11330
  exports.getFlightOrigin = getFlightOrigin;
@@ -11245,12 +11334,14 @@ exports.getLocationCandidates = getLocationCandidates;
11245
11334
  exports.getLocationType = getLocationType;
11246
11335
  exports.getLocationTypeName = getLocationTypeName;
11247
11336
  exports.getModuleCapabilityType = getModuleCapabilityType;
11337
+ exports.getModules = getModules;
11248
11338
  exports.getPlanetSubtype = getPlanetSubtype;
11249
11339
  exports.getPlanetSubtypes = getPlanetSubtypes;
11250
11340
  exports.getPositionAt = getPositionAt;
11251
11341
  exports.getRecipe = getRecipe;
11252
11342
  exports.getResourceTier = getResourceTier;
11253
11343
  exports.getResourceWeight = getResourceWeight;
11344
+ exports.getResources = getResources;
11254
11345
  exports.getStatDefinitions = getStatDefinitions;
11255
11346
  exports.getStatMappings = getStatMappings;
11256
11347
  exports.getStatMappingsForCapability = getStatMappingsForCapability;
@@ -11304,6 +11395,7 @@ exports.readCommonBase = readCommonBase;
11304
11395
  exports.removeFromStacks = removeFromStacks;
11305
11396
  exports.renderDescription = renderDescription;
11306
11397
  exports.resolveItem = resolveItem;
11398
+ exports.resolveItemCategory = resolveItemCategory;
11307
11399
  exports.resolveStats = resolveStats;
11308
11400
  exports.rollTier = rollTier;
11309
11401
  exports.rollWithinTier = rollWithinTier;
@@ -11315,8 +11407,9 @@ exports.stackToCargoItem = stackToCargoItem;
11315
11407
  exports.stacksEqual = stacksEqual;
11316
11408
  exports.statMappings = statMappings;
11317
11409
  exports.tierColors = tierColors;
11410
+ exports.tierLabel = tierLabel;
11318
11411
  exports.tierLabels = tierLabels;
11319
- exports.tierNumber = tierNumber;
11320
11412
  exports.toLocation = toLocation;
11413
+ exports.typeLabel = typeLabel;
11321
11414
  exports.validateSchedule = validateSchedule;
11322
11415
  //# sourceMappingURL=shipload.js.map