변수명 재정의

This commit is contained in:
2024-03-11 17:05:00 +00:00
parent 28b78e0872
commit d40995e1d9
15 changed files with 63 additions and 59 deletions
+7 -7
View File
@@ -12,7 +12,7 @@ import { addSeconds } from "date-fns";
export class General extends LazyEntityUpdater<IGeneralEntity> {
protected readonly _indirectNames: (keyof IGeneralEntity)[] = [
"id", "nationID", "squadID", "nationID", "turntime"
"id", "nationID", "squadID", "nationID", "turnTime"
];
protected readonly _entityType = "General";
protected readonly _raw: IGeneralEntity;
@@ -142,24 +142,24 @@ export class General extends LazyEntityUpdater<IGeneralEntity> {
else{
raw.officerLevel = OfficerLevel.normal;
}
raw.nationBelong = 0;
raw.nationJoinedRelYear = 0;
});
}
public updateTurntime(){
public updateTurnTime(){
const secondsPerTurn = this.rsc.gameEnv().raw.secondsPerTurn;
this.forceUpdate((raw) => {
raw.turntime = addSeconds(raw.turntime, secondsPerTurn);
raw.turnTime = addSeconds(raw.turnTime, secondsPerTurn);
});
}
public compareTurntime(other: General): number {
if(this._raw.turntime < other._raw.turntime){
public compareTurnTime(other: General): number {
if(this._raw.turnTime < other._raw.turnTime){
return -1;
}
if(this._raw.turntime > other._raw.turntime){
if(this._raw.turnTime > other._raw.turnTime){
return 1;
}