Files
node-metaverse/lib/classes/packets/AvatarAnimation.ts
2017-11-24 03:32:37 +00:00

43 lines
1.1 KiB
TypeScript

// This file has been automatically generated by writePacketClasses.js
import {UUID} from '../UUID';
import {MessageFlags} from '../../enums/MessageFlags';
import {Packet} from '../Packet';
export class AvatarAnimationPacket implements Packet
{
name = 'AvatarAnimation';
flags = MessageFlags.Trusted | MessageFlags.FrequencyHigh;
id = 20;
Sender: {
ID: UUID;
};
AnimationList: {
AnimID: UUID;
AnimSequenceID: number;
}[];
AnimationSourceList: {
ObjectID: UUID;
}[];
PhysicalAvatarEventList: {
TypeData: string;
}[];
getSize(): number
{
return ((20) * this.AnimationList.length) + ((16) * this.AnimationSourceList.length) + ((this.calculateVarVarSize(this.PhysicalAvatarEventList, 'TypeData', 1)) * this.PhysicalAvatarEventList.length) + 19;
}
calculateVarVarSize(block: object[], paramName: string, extraPerVar: number): number
{
let size = 0;
block.forEach((bl: any) =>
{
size += bl[paramName].length + extraPerVar;
});
return size;
}
}