add comment to unused labelUpload method and clean up removeUnit ordering

- Move unitGrid.removeUnit() call to beginning of removeUnit method
  for cleaner code organization
This commit is contained in:
scamiv
2025-12-04 16:33:15 +01:00
parent c1ea8445d1
commit ebfdf871ae
2 changed files with 7 additions and 1 deletions
@@ -572,6 +572,12 @@ export class TerritoryWebGLRenderer {
return { rows: rowsUploaded, bytes: bytesUploaded };
}
/**
* Formats upload metrics into a human-readable string for logging/debugging.
* Used for performance monitoring of WebGL texture uploads, bucketing values
* to provide meaningful categories rather than exact numbers.
* currently unused.
*/
private labelUpload(
base: string,
metrics: { rows: number; bytes: number },
+1 -1
View File
@@ -764,10 +764,10 @@ export class GameImpl implements Game {
}
}
removeUnit(u: Unit) {
this.unitGrid.removeUnit(u);
if (u.type() === UnitType.DefensePost) {
this.updateDefendedStateForDefensePost(u.tile(), u.owner() as PlayerImpl);
}
this.unitGrid.removeUnit(u);
if (u.hasTrainStation()) {
this._railNetwork.removeStation(u);
}