have Team be an enum instead of an object, this was causing equality problems.

This commit is contained in:
Evan
2025-04-05 21:39:12 -07:00
parent f620264ce3
commit c7356a7348
16 changed files with 72 additions and 93 deletions
+4 -6
View File
@@ -15,7 +15,7 @@ import {
PlayerInfo,
PlayerProfile,
PlayerType,
TeamName,
Team,
TerrainType,
TerraNullius,
Tick,
@@ -177,8 +177,8 @@ export class PlayerView {
id(): PlayerID {
return this.data.id;
}
teamName(): TeamName {
return this.data.teamName;
team(): Team | null {
return this.data.team;
}
type(): PlayerType {
return this.data.playerType;
@@ -223,9 +223,7 @@ export class PlayerView {
}
isOnSameTeam(other: PlayerView): boolean {
return (
this.data.teamName != null && this.data.teamName == other.data.teamName
);
return this.data.team != null && this.data.team == other.data.team;
}
isFriendly(other: PlayerView): boolean {