model.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import type { Beacon, Machine, Module } from "../../scripts/factorio-dump/process-data.models";
  2. export interface InserterConfig {
  3. /** Used to group items onto mixed belts (e.g., assigning "in-1" to both Iron and Copper) */
  4. inserterId?: string;
  5. presetId: string;
  6. swingTicks: number;
  7. stackSize: number;
  8. }
  9. export interface ClockConfig {
  10. /** Configurations for inputs, keyed by the item's name */
  11. inputs: Record<string, InserterConfig>;
  12. /** Configurations for outputs, keyed by the item's name */
  13. outputs: Record<string, InserterConfig>;
  14. /** Target number of machines to scale the final inserter blueprint */
  15. machineCount?: number;
  16. }
  17. export interface BeaconGroup {
  18. id?: string;
  19. beacon: Beacon;
  20. beaconQualityLevel?: number;
  21. count: number;
  22. modules: Array<{ module: Module; qualityLevel: number }>;
  23. }
  24. export interface MachineSetup {
  25. machine: Machine;
  26. machineQualityLevel?: number; // 0 = Normal, 1 = Uncommon, 2 = Rare, 3 = Epic, 5 = Legendary
  27. machineModules: Array<{ module: Module; qualityLevel: number }>;
  28. beacons: Array<BeaconGroup>;
  29. }
  30. export interface CalculatedTimings {
  31. actualCraftingSpeed: number;
  32. productivityBonus: number;
  33. singleCraftTicks: number;
  34. craftsPerSecond: number;
  35. /** The maximum multiplier of a recipe's base ingredients an assembler will buffer before stalling input inserters */
  36. overloadMultiplier: number;
  37. }
  38. export interface BatchPlan {
  39. craftsPerCycle: number;
  40. durationTicks: number;
  41. timings: CalculatedTimings;
  42. inputs: Record<string, { totalAmount: number; baseAmount: number }>;
  43. outputs: Record<string, { totalAmount: number; baseAmount: number; yieldPerCraft: number; outputBlockLimit: number }>;
  44. }