TypeScript fixes
This commit is contained in:
parent
da90e012fc
commit
602e4abece
@ -2,7 +2,7 @@ import express from 'express';
|
|||||||
import crypto from 'crypto';
|
import crypto from 'crypto';
|
||||||
import { layout, staticData } from '../util/layout';
|
import { layout, staticData } from '../util/layout';
|
||||||
import basePath from '../basepath';
|
import basePath from '../basepath';
|
||||||
import { types, debug, all, info, INCOMING_GET_BATCH_MS } from './games/constants';
|
import { debug, all, info, INCOMING_GET_BATCH_MS } from './games/constants';
|
||||||
|
|
||||||
import { getValidRoads, getValidCorners, isRuleEnabled } from '../util/validLocations';
|
import { getValidRoads, getValidCorners, isRuleEnabled } from '../util/validLocations';
|
||||||
import {
|
import {
|
||||||
|
@ -264,6 +264,15 @@ export const createGame = async (id: string | null = null) => {
|
|||||||
actions: [],
|
actions: [],
|
||||||
limits: {},
|
limits: {},
|
||||||
roll: 0,
|
roll: 0,
|
||||||
|
volcano: null,
|
||||||
|
free: false,
|
||||||
|
freeRoads: 0,
|
||||||
|
select: {},
|
||||||
|
active: null,
|
||||||
|
robberInAction: false,
|
||||||
|
placedRobber: false,
|
||||||
|
developmentPurchased: false,
|
||||||
|
offer: null,
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
"victory-points": {
|
"victory-points": {
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
import { MAX_ROADS, MAX_CITIES, MAX_SETTLEMENTS } from "./constants";
|
import { MAX_ROADS, MAX_CITIES, MAX_SETTLEMENTS } from "./constants";
|
||||||
import type { Player, PlayerColor } from "./types";
|
import { PLAYER_COLORS, type Player, type PlayerColor } from "./types";
|
||||||
|
|
||||||
export const newPlayer = (color: PlayerColor): Player => {
|
export const newPlayer = (color: PlayerColor): Player => {
|
||||||
|
const tmp = {} as any;
|
||||||
|
PLAYER_COLORS.forEach((c) => { tmp[c] = false; });
|
||||||
|
const offerRejected = { ...tmp };
|
||||||
return {
|
return {
|
||||||
roads: MAX_ROADS,
|
roads: MAX_ROADS,
|
||||||
cities: MAX_CITIES,
|
cities: MAX_CITIES,
|
||||||
@ -16,6 +19,8 @@ export const newPlayer = (color: PlayerColor): Player => {
|
|||||||
sheep: 0,
|
sheep: 0,
|
||||||
wood: 0,
|
wood: 0,
|
||||||
brick: 0,
|
brick: 0,
|
||||||
|
desert: 0, /* Not used -- for Typescript compliance */
|
||||||
|
bank: 0, /* Not used -- for Typescript compliance */
|
||||||
army: 0,
|
army: 0,
|
||||||
development: [],
|
development: [],
|
||||||
color: color,
|
color: color,
|
||||||
@ -33,6 +38,9 @@ export const newPlayer = (color: PlayerColor): Player => {
|
|||||||
turnNotice: "",
|
turnNotice: "",
|
||||||
longestRoad: 0,
|
longestRoad: 0,
|
||||||
banks: [],
|
banks: [],
|
||||||
|
gives: [],
|
||||||
|
gets: [],
|
||||||
|
offerRejected,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user