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:
parent
3759f604e8
commit
9d4da5da13
2 changed files with 9 additions and 7 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue