1
0
Fork 0
mirror of https://github.com/demostf/demo.js synced 2026-06-04 00:54:14 +02:00

improve handling of teams

This commit is contained in:
Robin Appelman 2017-12-16 12:36:11 +01:00
commit 9d4da5da13
2 changed files with 9 additions and 7 deletions

View file

@ -42,14 +42,17 @@ export class PacketEntity {
}
public getProperty(originTable: string, name: string) {
for (const prop of this.props) {
if (prop.definition.ownerTableName === originTable && prop.definition.name === name) {
return prop;
}
const prop = PacketEntity.getPropByFullName(this.props, `${originTable}.${name}`);
if (prop) {
return prop;
}
throw new Error(`Property not found in entity (${originTable}.${name})`);
}
public hasProperty(originTable: string, name: string) {
return PacketEntity.getPropByFullName(this.props, `${originTable}.${name}`) !== null;
}
public clone(): PacketEntity {
const result = new PacketEntity(this.serverClass, this.entityIndex, this.pvs);
for (const prop of this.props) {