Skip to content

REST Api

JaGoTu edited this page Jul 13, 2020 · 4 revisions
export const endpoints = {
    game: "/game", // GET, vraci uplne ta stejna data jako kdyz se dava ulozit hru
    shipDetail: (shipId: string, teamId: string) => `shipDetail?ship=${shipId}&team=${teamId}`,
    planAction: (shipId: string, teamId: string, action: ShipAction) => `/team/${teamId}/ship/${shipId}/actions/${action}`, // POST method
    planAndEvaluateModificationTransaction: (shipId: string, teamId: string, action: Transaction) => `/team/${teamId}/ship/${shipId}/modification-transaction/${action}`, // POST method
    deleteAllActions: (shipId: string, teamId: string) => `/team/${teamId}/ship/${shipId}/actions`, // DELETE method
    deleteSomeActions: (shipId: string, teamId: string, howMany: number) => `/team/${teamId}/ship/${shipId}/actions/${howMany}`, // DELETE method
    possibleEnhancements: (shipId: string, teamId: string, action: ShipAction) => `/team/${teamId}/ship/${shipId}/actions/${action}/plannable-enhancements`, // GET method, get all enhancements that the transaction accepts
    boardTile: (coord: string) => `/board/tile/${coord}` // GET method, coord in format (x,y)
}

value of Action is the name of the JavaClass, e.g. UpgradeShipViaRepayment. There is one exception: CannonVolley has specific actions for left and right variants, i.e.:

LeftCannonsChainShotVolley,
LeftCannonsHeavyBallVolley, 
LeftCannonsSimpleVolley,
RightCannonsChainShotVolley,
RightCannonsHeavyBallVolley,
RightCannonsSimpleVolley
Clone this wiki locally