Files
node-metaverse/lib/classes/packets/AgentAnimation.ts

41 lines
1012 B
TypeScript
Raw Normal View History

2017-11-24 03:32:37 +00:00
// This file has been automatically generated by writePacketClasses.js
import {UUID} from '../UUID';
import {MessageFlags} from '../../enums/MessageFlags';
import {Packet} from '../Packet';
export class AgentAnimationPacket implements Packet
{
name = 'AgentAnimation';
flags = MessageFlags.FrequencyHigh;
id = 5;
AgentData: {
AgentID: UUID;
SessionID: UUID;
};
AnimationList: {
AnimID: UUID;
StartAnim: boolean;
}[];
PhysicalAvatarEventList: {
TypeData: string;
}[];
getSize(): number
{
return ((17) * this.AnimationList.length) + ((this.calculateVarVarSize(this.PhysicalAvatarEventList, 'TypeData', 1)) * this.PhysicalAvatarEventList.length) + 34;
}
calculateVarVarSize(block: object[], paramName: string, extraPerVar: number): number
{
let size = 0;
block.forEach((bl: any) =>
{
size += bl[paramName].length + extraPerVar;
});
return size;
}
}