engined adapted to TS6
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import Decimal, { DecimalSource } from "break_eternity.js";
|
||||
import { BehaviourDisplayInfo, BehaviourLink, BehaviourSocket, Resource, Resources, SerializedBehaviour } from "../types";
|
||||
import Decimal, { type DecimalSource } from "break_eternity.js";
|
||||
import type { BehaviourDisplayInfo, BehaviourLink, BehaviourSocket, Resource, Resources, SerializedBehaviour } from "../types";
|
||||
|
||||
export abstract class Behaviour {
|
||||
public readonly id: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Decimal, { DecimalSource } from "break_eternity.js";
|
||||
import { BehaviourDisplayInfo, Resource, Resources, SerializedBehaviour, SerializedConverter } from "../types";
|
||||
import Decimal, { type DecimalSource } from "break_eternity.js";
|
||||
import type { BehaviourDisplayInfo, Resource, Resources, SerializedBehaviour, SerializedConverter } from "../types";
|
||||
import { Behaviour } from "./base";
|
||||
|
||||
export class Converter extends Behaviour {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Decimal, { DecimalSource } from "break_eternity.js";
|
||||
import { BehaviourDisplayInfo, Resource, Resources, SerializedBehaviour, SerializedStorage } from "../types";
|
||||
import Decimal, { type DecimalSource } from "break_eternity.js";
|
||||
import type { BehaviourDisplayInfo, Resource, Resources, SerializedBehaviour, SerializedStorage } from "../types";
|
||||
import { Behaviour } from "./base";
|
||||
|
||||
export class Storage extends Behaviour {
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
import { Behaviour, Converter, Storage } from "../behaviours";
|
||||
import { SerializedBehaviour, SerializedConverter, SerializedStorage } from "../types";
|
||||
import { type Behaviour, Converter, Storage } from "../behaviours";
|
||||
import type { SerializedBehaviour, SerializedConverter, SerializedStorage } from "../types";
|
||||
|
||||
export function deserializeBehaviour(value: SerializedBehaviour): Behaviour {
|
||||
switch (value.kind) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Game } from "../game";
|
||||
import { SerializedGame } from "../types";
|
||||
import type { SerializedGame } from "../types";
|
||||
import { serializeBehaviour } from "./behaviour";
|
||||
|
||||
export function serializeGame(game: Game): SerializedGame {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Resource, Resources } from "./resource";
|
||||
import type { Resource, Resources } from "./resource";
|
||||
|
||||
export type BehaviourResourcePin = {
|
||||
resource: Resource;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Decimal from "break_eternity.js";
|
||||
import type Decimal from "break_eternity.js";
|
||||
|
||||
export type Resource = 'tree' | 'wood' | 'stone';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Unit } from './unit';
|
||||
import { DecimalSource } from "break_eternity.js";
|
||||
import { Resource } from "./resource";
|
||||
import type { Unit } from './unit';
|
||||
import type { DecimalSource } from "break_eternity.js";
|
||||
import type { Resource } from "./resource";
|
||||
|
||||
export type SerializedInputLink = {
|
||||
target: SerializedBehaviour['id'],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Behaviour } from "../behaviours";
|
||||
import type { Behaviour } from "../behaviours";
|
||||
|
||||
export type Unit = {
|
||||
id: string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Behaviour } from "../behaviours";
|
||||
import type { Behaviour } from "../behaviours";
|
||||
|
||||
/** Orders behaviours so that whatever a behaviour's inputs link to comes before it (a dependency cycle just falls back to encounter order). */
|
||||
export function orderByDependency(behaviours: Behaviour[]): Behaviour[] {
|
||||
|
||||
Reference in New Issue
Block a user