You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-21 07:56:19 +00:00
Move to Renderer V2
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class QuizDataMessageParser implements IMessageParser
|
||||
{
|
||||
private _quizCode: string;
|
||||
private _questionIds: number[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._quizCode = null;
|
||||
this._questionIds = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._quizCode = wrapper.readString();
|
||||
|
||||
const size = wrapper.readInt();
|
||||
|
||||
this._questionIds = [];
|
||||
|
||||
for(let i = 0; i < size; i++) this._questionIds.push(wrapper.readInt());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get quizCode(): string
|
||||
{
|
||||
return this._quizCode;
|
||||
}
|
||||
|
||||
public get questionIds(): number[]
|
||||
{
|
||||
return this._questionIds;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user