refactor: update inline-schema to import accessors
This commit is contained in:
Vendored
+2
-2
@@ -6,5 +6,5 @@ type BoopPartTable = readonly {
|
||||
|
||||
export type BoopPart = BoopPartTable[number];
|
||||
|
||||
declare const data: BoopPartTable;
|
||||
export default data;
|
||||
declare function getData(): BoopPartTable;
|
||||
export default getData;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import parts from './boopPart.csv';
|
||||
import getParts from './boopPart.csv';
|
||||
import {createRegion, moveToRegion, Region} from "@/core/region";
|
||||
import {createPartsFromTable} from "@/core/part-factory";
|
||||
import {BoopPart} from "@/samples/boop/types";
|
||||
@@ -6,6 +6,7 @@ import {BOARD_SIZE} from "@/samples/boop/constants";
|
||||
import {PlayerType, PieceType, RegionType} from "@/samples/boop/types";
|
||||
|
||||
export function createInitialState() {
|
||||
const parts = getParts();
|
||||
const pieces = createPartsFromTable(
|
||||
parts,
|
||||
(item, index) => `${item.player}-${item.type}-${index + 1}`,
|
||||
|
||||
Reference in New Issue
Block a user