新增hashSet
This commit is contained in:
@@ -8,7 +8,7 @@ module es {
|
||||
}
|
||||
}
|
||||
|
||||
export class Entity {
|
||||
export class Entity implements IEqualityComparable {
|
||||
public static _idGenerator: number = 0;
|
||||
public static entityComparer: IComparer<Entity> = new EntityComparer();
|
||||
/**
|
||||
@@ -399,6 +399,14 @@ module es {
|
||||
return compare;
|
||||
}
|
||||
|
||||
public equals(other: Entity): boolean {
|
||||
return this.compareTo(other) == 0;
|
||||
}
|
||||
|
||||
public getHashCode(): number {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public toString(): string {
|
||||
return `[Entity: name: ${this.name}, tag: ${this.tag}, enabled: ${this.enabled}, depth: ${this.updateOrder}]`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user