31 lines
602 B
TypeScript
31 lines
602 B
TypeScript
import { MAX_ROADS, MAX_CITIES, MAX_SETTLEMENTS } from "./constants";
|
|
import type { Player } from "./types";
|
|
|
|
export const newPlayer = (color: string): Player => {
|
|
return {
|
|
roads: MAX_ROADS,
|
|
cities: MAX_CITIES,
|
|
settlements: MAX_SETTLEMENTS,
|
|
points: 0,
|
|
status: "Not active",
|
|
lastActive: 0,
|
|
resources: 0,
|
|
order: 0,
|
|
stone: 0,
|
|
wheat: 0,
|
|
sheep: 0,
|
|
wood: 0,
|
|
brick: 0,
|
|
army: 0,
|
|
development: [],
|
|
color: color,
|
|
name: "",
|
|
totalTime: 0,
|
|
turnStart: 0,
|
|
ports: 0,
|
|
developmentCards: 0,
|
|
} as Player;
|
|
};
|
|
|
|
export default newPlayer;
|