50 lines
1.5 KiB
TypeScript
50 lines
1.5 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 GroupActiveProposalItemReplyPacket implements Packet
|
|
{
|
|
name = 'GroupActiveProposalItemReply';
|
|
flags = MessageFlags.Trusted | MessageFlags.Zerocoded | MessageFlags.FrequencyLow;
|
|
id = 4294902120;
|
|
|
|
AgentData: {
|
|
AgentID: UUID;
|
|
GroupID: UUID;
|
|
};
|
|
TransactionData: {
|
|
TransactionID: UUID;
|
|
TotalNumItems: number;
|
|
};
|
|
ProposalData: {
|
|
VoteID: UUID;
|
|
VoteInitiator: UUID;
|
|
TerseDateID: string;
|
|
StartDateTime: string;
|
|
EndDateTime: string;
|
|
AlreadyVoted: boolean;
|
|
VoteCast: string;
|
|
Majority: number;
|
|
Quorum: number;
|
|
ProposalText: string;
|
|
}[];
|
|
|
|
getSize(): number
|
|
{
|
|
return ((this.calculateVarVarSize(this.ProposalData, 'TerseDateID', 1) + this.calculateVarVarSize(this.ProposalData, 'StartDateTime', 1) + this.calculateVarVarSize(this.ProposalData, 'EndDateTime', 1) + this.calculateVarVarSize(this.ProposalData, 'VoteCast', 1) + this.calculateVarVarSize(this.ProposalData, 'ProposalText', 1) + 41) * this.ProposalData.length) + 53;
|
|
}
|
|
|
|
calculateVarVarSize(block: object[], paramName: string, extraPerVar: number): number
|
|
{
|
|
let size = 0;
|
|
block.forEach((bl: any) =>
|
|
{
|
|
size += bl[paramName].length + extraPerVar;
|
|
});
|
|
return size;
|
|
}
|
|
|
|
}
|