refac: rsc -> rc

This commit is contained in:
2024-03-15 16:13:27 +00:00
parent 6a6bdba08b
commit 78bcc95e2e
10 changed files with 46 additions and 46 deletions
+7 -7
View File
@@ -25,20 +25,20 @@ export class General extends LazyEntityUpdater<IGeneralEntity> {
constructor(
raw: IGeneralEntity,
protected readonly rsc: IResourceController
protected readonly rc: IResourceController
){
super();
this._raw = raw;
}
public bootstrap(){
const rsc = this.rsc;
const rc = this.rc;
const raw = this._raw;
this._city = new WeakRef(must(rsc.city(raw.cityID)));
this._nation = new WeakRef(must(rsc.nation(raw.nationID)));
this._city = new WeakRef(must(rc.city(raw.cityID)));
this._nation = new WeakRef(must(rc.nation(raw.nationID)));
if(raw.squadID){
this._squad = new WeakRef(must(rsc.squad(raw.squadID, raw.nationID)));
this._squad = new WeakRef(must(rc.squad(raw.squadID, raw.nationID)));
}
this.reconfigureIActionHandlers();
@@ -141,7 +141,7 @@ export class General extends LazyEntityUpdater<IGeneralEntity> {
else{
raw.officerLevel = OfficerLevel.normal;
}
raw.nationJoinedYearMonth = this.rsc.gameEnv.raw.yearMonth;
raw.nationJoinedYearMonth = this.rc.gameEnv.raw.yearMonth;
});
nation.notifyJoinGeneral(this);
@@ -153,7 +153,7 @@ export class General extends LazyEntityUpdater<IGeneralEntity> {
}
public updateTurnTime(){
const secondsPerTurn = this.rsc.gameEnv.raw.secondsPerTurn;
const secondsPerTurn = this.rc.gameEnv.raw.secondsPerTurn;
this.forceUpdate((raw) => {
raw.turnTime = addSeconds(raw.turnTime, secondsPerTurn);