From a1cf5f608a7a0e42e2b1cbddb3df08470154767e Mon Sep 17 00:00:00 2001 From: Matt Bilker Date: Fri, 6 Mar 2020 10:30:41 +0000 Subject: [PATCH] chuni: Put event IDs in separate static file --- src/chunithm/handler/getGameEvent.ts | 174 +------------------------- src/chunithm/static/event.ts | 176 +++++++++++++++++++++++++++ 2 files changed, 178 insertions(+), 172 deletions(-) create mode 100644 src/chunithm/static/event.ts diff --git a/src/chunithm/handler/getGameEvent.ts b/src/chunithm/handler/getGameEvent.ts index 65f728c..322b683 100644 --- a/src/chunithm/handler/getGameEvent.ts +++ b/src/chunithm/handler/getGameEvent.ts @@ -2,185 +2,15 @@ import { GameEventJson } from "../proto/gameEvent"; import { Repositories } from "../repo"; import { GetGameEventRequest } from "../request/getGameEvent"; import { GetGameEventResponse } from "../response/getGameEvent"; +import { EVENT_IDS } from "../static/event"; export default async function getGameEvent( rep: Repositories, req: GetGameEventRequest ): Promise { - const gameEventIds = [ - 0, - 1506, - 1604, - 1702, - 1953, - 2206, - 2353, - 2553, - 2804, - 2999, - 3000, - 3001, - 3002, - 3003, - 3006, - 3007, - 3008, - 3009, - 3010, - 3011, - 3012, - 3013, - 3014, - 3015, - 3016, - 3017, - 3018, - 3019, - 3020, - 3021, - 3026, - 3027, - 20003, - 3004, - 3005, - 3022, - 3023, - 3024, - 3025, - 3028, - 3029, - 3030, - 3031, - 3032, - 3100, - 3101, - 3102, - 3103, - 3104, - 3150, - 3151, - 3152, - 3153, - 3154, - 3155, - 3156, - 3157, - 3158, - 3159, - 3160, - 3161, - 3162, - 3163, - 3164, - 3165, - 3166, - 3167, - 3168, - 3169, - 3200, - 3201, - 3202, - 3203, - 3204, - 3205, - 3206, - 3207, - 3208, - 3209, - 3210, - 3211, - 3212, - 3213, - 3214, - 3215, - 3216, - 3217, - 3218, - 3219, - 3250, - 3251, - 3252, - 3253, - 3254, - 3255, - 3256, - 3257, - 3258, - 3259, - 3260, - 3261, - 3262, - 3263, - 3300, - 3301, - 3302, - 3303, - 3304, - 3305, - 3306, - 3307, - 3308, - 3309, - 3310, - 3311, - 3350, - 3351, - 3352, - 3353, - 3400, - 3401, - 3402, - 3403, - 3404, - 3405, - 3406, - 3407, - 3408, - 3409, - 3410, - 3411, - 3412, - 3413, - 3414, - 3415, - 3416, - 3417, - 3450, - 3451, - 3452, - 3453, - 3454, - 3455, - 3500, - 3501, - 3502, - 3503, - 3504, - 3505, - 3506, - 3507, - 3508, - 3509, - 3510, - 3511, - 3512, - 3513, - 3514, - 3515, - 3550, - 3551, - 3552, - 3553, - 3554, - 3555, - 3556, - 3557, - 3580, - 3581, - ]; const gameEventList: GameEventJson[] = []; - for (const id of gameEventIds) { + for (const id of EVENT_IDS) { gameEventList.push({ type: req.type, id: id.toString(), diff --git a/src/chunithm/static/event.ts b/src/chunithm/static/event.ts new file mode 100644 index 0000000..2eebf6c --- /dev/null +++ b/src/chunithm/static/event.ts @@ -0,0 +1,176 @@ +export const EVENT_IDS = Object.freeze([ + // A000 + 0, + 1506, + 1604, + 1702, + 1953, + 2206, + 2353, + 2553, + 2804, + 2999, + 3000, + 3001, + 3002, + 3003, + 3006, + 3007, + 3008, + 3009, + 3010, + 3011, + 3012, + 3013, + 3014, + 3015, + 3016, + 3017, + 3018, + 3019, + 3020, + 3021, + 3026, + 3027, + 20003, + + // A014 + 3004, + 3005, + 3022, + 3023, + 3024, + 3025, + 3028, + 3029, + 3030, + 3031, + 3032, + 3100, + 3101, + 3102, + 3103, + 3104, + 3150, + 3151, + 3152, + 3153, + 3154, + 3155, + 3156, + 3157, + 3158, + 3159, + 3160, + 3161, + 3162, + 3163, + 3164, + 3165, + 3166, + 3167, + 3168, + 3169, + 3200, + 3201, + 3202, + 3203, + 3204, + 3205, + 3206, + 3207, + 3208, + 3209, + 3210, + 3211, + 3212, + 3213, + 3214, + 3215, + 3216, + 3217, + 3218, + 3219, + 3250, + 3251, + 3252, + 3253, + 3254, + 3255, + 3256, + 3257, + 3258, + 3259, + 3260, + 3261, + 3262, + 3263, + 3300, + 3301, + 3302, + 3303, + 3304, + 3305, + 3306, + 3307, + 3308, + 3309, + 3310, + 3311, + 3350, + 3351, + 3352, + 3353, + 3400, + 3401, + 3402, + 3403, + 3404, + 3405, + 3406, + 3407, + 3408, + 3409, + 3410, + 3411, + 3412, + 3413, + 3414, + 3415, + 3416, + 3417, + 3450, + 3451, + 3452, + 3453, + 3454, + 3455, + + // A017 + 3500, + 3501, + 3502, + 3503, + 3504, + 3505, + 3506, + 3507, + 3508, + 3509, + 3510, + 3511, + 3512, + 3513, + 3514, + 3515, + 3550, + 3551, + 3552, + 3553, + 3554, + 3555, + 3556, + 3557, + 3580, + 3581, +]);