From 3d67f8bb55cf6b3fa4a37a4c98eecfebc76532c1 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sat, 9 Mar 2024 09:18:59 +0000 Subject: [PATCH] feat: General.compareTurntime --- @sammo/game_logic/src/General.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/@sammo/game_logic/src/General.ts b/@sammo/game_logic/src/General.ts index a06a379..884ac72 100644 --- a/@sammo/game_logic/src/General.ts +++ b/@sammo/game_logic/src/General.ts @@ -155,4 +155,21 @@ export class General extends LazyEntityUpdater { } + public compareTurntime(other: General): number { + if(this._raw.turntime < other._raw.turntime){ + return -1; + } + if(this._raw.turntime > other._raw.turntime){ + return 1; + } + + if(this._raw.id < other._raw.id){ + return -1; + } + if(this._raw.id > other._raw.id){ + return 1; + } + return 0; + } + } \ No newline at end of file