Files
core/hwe/ts/SammoAPI.ts
T
Hide_D ab9bdf3822 feat: 사령부의 턴 선택기에 고급 모드 적용 (#212)
- 사령부 턴 페이지를 vue3 setup 형태로 변경
- 턴 조작기 함수 중 공용 함수 분리
- 사령부 턴 조작기 코드 범위를 다시 조정
- 사령부 일반 모드, 고급 모드 이원화
- 사령부에서 다른 수뇌의 턴 '복사하기' 제공

Co-authored-by: Hide_D <hided62@gmail.com>
Reviewed-on: https://storage.hided.net/gitea/devsam/core/pulls/212
Co-authored-by: hide_d <hided62@gmail.com>
Co-committed-by: hide_d <hided62@gmail.com>
2022-03-26 23:11:58 +09:00

65 lines
1.8 KiB
TypeScript

import type { InvalidResponse, ReserveBulkCommandResponse } from "./defs";
import type { Args } from "./processing/args";
import { callSammoAPI, done, type CallbackT, type RawArgType, type ValidResponse } from "./util/callSammoAPI";
export type { ValidResponse, InvalidResponse };
import { APIPathGen } from "./util/APIPathGen.js";
const apiRealPath = {
Betting: {
Bet: done,
GetBettingDetail: done,
GetBettingList: done,
},
Command: {
GetReservedCommand: done,
PushCommand: done,
RepeatCommand: done,
ReserveCommand: done,
ReserveBulkCommand: done as CallbackT<{
turnList: number[],
action: string,
arg: Args
}[], ReserveBulkCommandResponse>,
},
General: {
Join: done,
},
InheritAction: {
BuyHiddenBuff: done,
BuyRandomUnique: done,
BuySpecificUnique: done,
ResetSpecialWar: done,
ResetTurnTime: done,
SetNextSpecialWar: done,
},
Misc: { UploadImage: done },
NationCommand: {
GetReservedCommand: done,
PushCommand: done,
RepeatCommand: done,
ReserveCommand: done,
ReserveBulkCommand: done as CallbackT<{
turnList: number[],
action: string,
arg: Args
}[], ReserveBulkCommandResponse>,
},
Nation: {
SetNotice: done,
SetScoutMsg: done,
SetBill: done,
SetRate: done,
SetSecretLimit: done,
SetBlockWar: done,
SetBlockScout: done,
},
} as const;
export const SammoAPI = APIPathGen(apiRealPath, (path: string[]) => {
return (args?: RawArgType, returnError?: boolean) => {
if (returnError) {
return callSammoAPI(path.join('/'), args, true);
}
return callSammoAPI(path.join('/'), args);
};
});