You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-20 07:26:18 +00:00
35 lines
820 B
TypeScript
35 lines
820 B
TypeScript
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
|
import { NewUserExperienceGiftOptions } from '../../incoming/nux';
|
|
|
|
export class NewUserExperienceGiftOfferMessageParser implements IMessageParser
|
|
{
|
|
private _giftOptions: NewUserExperienceGiftOptions[];
|
|
|
|
public flush(): boolean
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public parse(wrapper: IMessageDataWrapper): boolean
|
|
{
|
|
if(!wrapper) return false;
|
|
|
|
const count = wrapper.readInt();
|
|
this._giftOptions = [];
|
|
let index = 0;
|
|
|
|
while(index < count)
|
|
{
|
|
this._giftOptions.push(new NewUserExperienceGiftOptions(wrapper));
|
|
index++;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public get giftOptions(): NewUserExperienceGiftOptions[]
|
|
{
|
|
return this._giftOptions;
|
|
}
|
|
}
|