From 30594fa88b3f61037b948287053198c97af7ffce Mon Sep 17 00:00:00 2001 From: Elijah R Date: Wed, 14 Aug 2024 19:06:21 -0400 Subject: [PATCH] add example board --- common/src/board/Board.ts | 1 + common/src/board/Space.ts | 2 + common/src/board/Transport.ts | 6 + common/src/index.ts | 3 +- server/src/boards/earth.ts | 432 ++++++++++++++++++++++++++++++++++ 5 files changed, 443 insertions(+), 1 deletion(-) create mode 100644 common/src/board/Transport.ts create mode 100644 server/src/boards/earth.ts diff --git a/common/src/board/Board.ts b/common/src/board/Board.ts index e84253a..ffe29fe 100644 --- a/common/src/board/Board.ts +++ b/common/src/board/Board.ts @@ -1,5 +1,6 @@ import { Space } from "./Space.js"; export interface Board { + name: string; spaces: Space[]; } \ No newline at end of file diff --git a/common/src/board/Space.ts b/common/src/board/Space.ts index 05ff0b1..31442fa 100644 --- a/common/src/board/Space.ts +++ b/common/src/board/Space.ts @@ -3,6 +3,8 @@ export enum SpaceType { Property, Utility, Transport, + Tax, + LuxuryTax, Risk, Treasure, GoToPrison, diff --git a/common/src/board/Transport.ts b/common/src/board/Transport.ts new file mode 100644 index 0000000..173a57d --- /dev/null +++ b/common/src/board/Transport.ts @@ -0,0 +1,6 @@ +import { Space, SpaceType } from "./Space.js"; + +export interface Transport extends Space { + type: SpaceType.Transport; + basePrice: number; +} \ No newline at end of file diff --git a/common/src/index.ts b/common/src/index.ts index 6f6bc59..2b338f1 100644 --- a/common/src/index.ts +++ b/common/src/index.ts @@ -1,5 +1,6 @@ export * from './board/Board.js'; export * from './board/Space.js'; export * from './board/Property.js'; +export * from './board/Transport.js'; -export * from './protocol/protocol.js'; \ No newline at end of file +export * from './protocol/protocol.js'; diff --git a/server/src/boards/earth.ts b/server/src/boards/earth.ts new file mode 100644 index 0000000..eb06649 --- /dev/null +++ b/server/src/boards/earth.ts @@ -0,0 +1,432 @@ +import { Board, SpaceType, Property, Transport } from "@ntptg/common"; + +const EarthBoard: Board = { + name: "Earth", + spaces: [ + { + name: "Start", + type: SpaceType.Start, + svg: '' + }, + { + name: "Córdoba", + type: SpaceType.Property, + svg: '', + color: "AR", + basePrice: 60, + rent: { + 0: 2, + 1: 10, + 2: 30, + 3: 90, + 4: 160, + 5: 250 + } + } as Property, + { + name: "Treasure", + type: SpaceType.Treasure, + svg: '' + }, + { + name: "Buenos Aires", + type: SpaceType.Property, + svg: '', + color: "AR", + basePrice: 60, + rent: { + 0: 4, + 1: 20, + 2: 60, + 3: 180, + 4: 320, + 5: 450 + } + } as Property, + { + name: "Income Tax", + type: SpaceType.Tax, + svg: '', + }, + { + name: "CCS Airport", + type: SpaceType.Transport, + svg: '', + basePrice: 200 + } as Transport, + { + name: "Kolkata", + type: SpaceType.Property, + svg: '', + color: "IN", + basePrice: 100, + rent: { + 0: 6, + 1: 30, + 2: 90, + 3: 270, + 4: 400, + 5: 550 + }, + } as Property, + { + name: "Risk", + type: SpaceType.Risk, + svg: '' + }, + { + name: "Mumbai", + type: SpaceType.Property, + svg: '', + color: "IN", + basePrice: 100, + rent: { + 0: 6, + 1: 30, + 2: 90, + 3: 270, + 4: 400, + 5: 550 + } + } as Property, + { + name: "New Delhi", + type: SpaceType.Property, + svg: '', + color: "IN", + basePrice: 120, + rent: { + 0: 8, + 1: 40, + 2: 100, + 3: 300, + 4: 450, + 5: 600 + } + } as Property, + { + name: "Jail", + type: SpaceType.Prison, + svg: '', + }, + { + name: "Odessa", + type: SpaceType.Property, + svg: '', + color: "UA", + basePrice: 140, + rent: { + 0: 10, + 1: 50, + 2: 150, + 3: 450, + 4: 625, + 5: 750 + } + }as Property, + { + name: "Electric Company", + type: SpaceType.Utility, + svg: '', + }, + { + name: "Kharkiv", + type: SpaceType.Property, + svg: '', + color: "UA", + basePrice: 140, + rent: { + 0: 10, + 1: 50, + 2: 150, + 3: 450, + 4: 625, + 5: 750 + } + } as Property, + { + name: "Kyiv", + type: SpaceType.Property, + svg: '', + color: "UA", + basePrice: 160, + rent: { + 0: 12, + 1: 60, + 2: 180, + 3: 500, + 4: 700, + 5: 900 + } + } as Property, + { + name: "KBP Airport", + type: SpaceType.Transport, + svg: '', + basePrice: 200 + } as Transport, + { + name: "Nanjing", + type: SpaceType.Property, + svg: '', + color: "CN", + basePrice: 180, + rent: { + 0: 14, + 1: 70, + 2: 200, + 3: 550, + 4: 750, + 5: 950 + } + } as Property, + { + name: "Treasure", + type: SpaceType.Treasure, + svg: '' + }, + { + name: "Guangzhou", + type: SpaceType.Property, + svg: '', + color: "CN", + basePrice: 180, + rent: { + 0: 14, + 1: 70, + 2: 200, + 3: 550, + 4: 750, + 5: 950 + } + } as Property, + { + name: "Beijing", + type: SpaceType.Property, + svg: '', + color: "CN", + basePrice: 200, + rent: { + 0: 16, + 1: 80, + 2: 220, + 3: 600, + 4: 800, + 5: 1000 + } + } as Property, + { + name: "Rest Stop", + type: SpaceType.DoesNothing, + svg: '' + }, + { + name: "Montreal", + type: SpaceType.Property, + svg: '', + color: "CA", + basePrice: 220, + rent: { + 0: 18, + 1: 90, + 2: 250, + 3: 700, + 4: 875, + 5: 1050 + } + } as Property, + { + name: "Risk", + type: SpaceType.Risk, + svg: '' + }, + { + name: "Toronto", + type: SpaceType.Property, + svg: '', + color: "CA", + basePrice: 220, + rent: { + 0: 18, + 1: 90, + 2: 250, + 3: 700, + 4: 875, + 5: 1050 + } + } as Property, + { + name: "Ottawa", + type: SpaceType.Property, + svg: '', + color: "CA", + basePrice: 240, + rent: { + 0: 20, + 1: 100, + 2: 300, + 3: 750, + 4: 925, + 5: 1100 + } + } as Property, + { + name: "YOW Airport", + type: SpaceType.Transport, + svg: '', + }, + { + name: "Frankfurt", + type: SpaceType.Property, + svg: '', + color: "DE", + basePrice: 260, + rent: { + 0: 22, + 1: 110, + 2: 330, + 3: 800, + 4: 975, + 5: 1150 + } + } as Property, + { + name: "Munich", + type: SpaceType.Property, + svg: '', + color: "DE", + basePrice: 260, + rent: { + 0: 22, + 1: 110, + 2: 330, + 3: 800, + 4: 975, + 5: 1150 + } + } as Property, + { + name: "Water District", + type: SpaceType.Utility, + svg: '', + }, + { + name: "Berlin", + type: SpaceType.Property, + svg: '', + color: "DE", + basePrice: 280, + rent: { + 0: 24, + 1: 120, + 2: 360, + 3: 850, + 4: 1025, + 5: 1200 + } + } as Property, + { + name: "Go To Jail", + type: SpaceType.GoToPrison, + svg: '', + }, + { + name: "Manchester", + type: SpaceType.Property, + svg: '', + color: "UK", + basePrice: 300, + rent: { + 0: 26, + 1: 130, + 2: 390, + 3: 900, + 4: 1100, + 5: 1275 + } + } as Property, + { + name: "Birmingham", + type: SpaceType.Property, + svg: '', + color: "UK", + basePrice: 300, + rent: { + 0: 26, + 1: 130, + 2: 390, + 3: 900, + 4: 1100, + 5: 1275 + } + } as Property, + { + name: "Treasure", + type: SpaceType.Treasure, + svg: '' + }, + { + name: "London", + type: SpaceType.Property, + svg: '', + color: "UK", + basePrice: 320, + rent: { + 0: 28, + 1: 150, + 2: 450, + 3: 1000, + 4: 1200, + 5: 1400 + } + } as Property, + { + name: "LHR Airport", + type: SpaceType.Transport, + svg: '', + basePrice: 200 + } as Transport, + { + name: "Risk", + type: SpaceType.Risk, + svg: '' + }, + { + name: "Washington, D.C.", + type: SpaceType.Property, + svg: '', + color: "US", + basePrice: 350, + rent: { + 0: 35, + 1: 175, + 2: 500, + 3: 1100, + 4: 1300, + 5: 1500 + } + }, + { + name: "Tax Audit", + type: SpaceType.LuxuryTax, + svg: '' + }, + { + name: "New York City", + type: SpaceType.Property, + svg: '', + color: "US", + basePrice: 400, + rent: { + 0: 50, + 1: 200, + 2: 600, + 3: 1400, + 4: 1700, + 5: 2000 + } + } as Property + ] +}; + +export {EarthBoard}; \ No newline at end of file