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