type Entity = { entity_number: number; name: string; position: { x: number; y: number; }; direction: 1 | 2 | 3 | 4; }; export type BlueprintSignal = { type?: string; name: string; quality?: string; }; type NetworkState = { red: boolean; green: boolean; }; export type DeciderCondition = { first_signal: BlueprintSignal; comparator: "<" | ">" | "=" | "≥" | "≤" | "≠"; compare_type?: "and" | "or"; first_signal_networks?: NetworkState; } & ({ second_signal: BlueprintSignal; second_signal_networks?: NetworkState } | { constant?: number }); type DeciderOutput = { signal: BlueprintSignal; } & ({ copy_count_from_input: false; constant?: number } | { networks?: { red: boolean; green: boolean } }); export type DeciderCombinator = Entity & { name: "decider-combinator"; control_behavior: { decider_conditions: { conditions?: DeciderCondition[]; outputs?: DeciderOutput[]; else_outputs?: DeciderOutput[]; }; }; player_description: string; }; export type Blueprint = { blueprint: { item: "blueprint"; version: 562954249109505; icons: Array<{ signal: BlueprintSignal; index: 1 | 2 | 3 | 4 }>; entities: []; /**Each wires is represented by 4 number * [a, b, c, d] * a : entity_number of first entity * b : wire connector (1-4) of first entity * a : entity_number of second entity * b : wire connector (1-4) of second entity * Most entity have only 2 connector (red and green circuit) * Decider Combinator, Arithmetic Combinator and Selector Combinator have 4 connectors (2 inputs, 2 outputs) * 1 & 3 red * 2 & 4 green */ wires: Array>; }; };