pass along more generated types

This commit is contained in:
Rachel Powers
2024-04-18 15:31:31 -07:00
parent 3f65360811
commit c63a1b3a4f
6 changed files with 52 additions and 125 deletions

View File

@@ -1,85 +1,6 @@
import { LogicType, SlotLogicType } from "ic10emu_wasm";
export type SortingClass =
| "Default"
| "Kits"
| "Tools"
| "Resources"
| "Food"
| "Clothing"
| "Appliances"
| "Atmospherics"
| "Storage"
| "Ores"
| "Ices";
export type SlotClass =
| "None"
| "Helmet"
| "Suit"
| "Back"
| "GasFilter"
| "GasCanister"
| "Motherboard"
| "Circuitboard"
| "DataDisk"
| "Organ"
| "Ore"
| "Plant"
| "Uniform"
| "Entity"
| "Battery"
| "Egg"
| "Belt"
| "Tool"
| "Appliance"
| "Ingot"
| "Torpedo"
| "Cartridge"
| "AccessCard"
| "Magazine"
| "Circuit"
| "Bottle"
| "ProgrammableChip"
| "Glasses"
| "CreditCard"
| "DirtCanister"
| "SensorProcessingUnit"
| "LiquidCanister"
| "LiquidBottle"
| "Wreckage"
| "SoundCartridge"
| "DrillHead"
| "ScanningHead"
| "Flare"
| "Blocked";
export type NetworkType =
| "None"
| "Pipe"
| "Power"
| "Data"
| "Chute"
| "Elevator"
| "PipeLiquid"
| "LandingPad"
| "LaunchPad"
| "PowerAndData"
| "All";
export type ConnectionRole =
| "None"
| "Input"
| "Input2"
| "Output"
| "Output2"
| "Waste";
export type FieldType = "Read" | "Write" | "ReadWrite";
export type ReagentMode = "Contents" | "Recipe" | "Required" | "TotalContents";
export type BatchMode = "Average" | "Maximum" | "Minimum" | "Sum";
import { LogicType, SlotLogicType, SortingClass, SlotType, FieldType, ReagentMode, BatchMode, ConnectionType, ConnectionRole } from "ic10emu_wasm";
export interface DeviceDBItem {
slotclass: SlotClass;
slotclass: SlotType;
sorting: SortingClass;
maxquantity?: number;
filtertype?: string;
@@ -96,7 +17,7 @@ export interface DeviceDBDevice {
}
export interface DeviceDBConnection {
typ: NetworkType;
typ: ConnectionType;
role: ConnectionRole;
name: string;
}
@@ -106,7 +27,7 @@ export interface DeviceDBEntry {
hash: number;
title: string;
desc: string;
slots?: { name: string; typ: SlotClass }[];
slots?: { name: string; typ: SlotType }[];
logic?: { [key in LogicType]?: FieldType };
slotlogic?: { [key in SlotLogicType]?: number[] };
modes?: { [key: number]: string };

View File

@@ -1,4 +1,4 @@
import { DeviceRef, DeviceTemplate, LogicType, SlotLogicType, VM, init } from "ic10emu_wasm";
import { DeviceRef, DeviceTemplate, LogicType, SlotLogicType, VMRef, init } from "ic10emu_wasm";
import { DeviceDB } from "./device_db";
import "./base_device";
@@ -17,7 +17,7 @@ export interface ToastMessage {
}
class VirtualMachine extends EventTarget {
ic10vm: VM;
ic10vm: VMRef;
_devices: Map<number, DeviceRef>;
_ics: Map<number, DeviceRef>;