Move to Renderer V2

This commit is contained in:
duckietm
2024-04-03 09:27:56 +02:00
parent 110c3ad393
commit b3134ce50b
4080 changed files with 115593 additions and 66375 deletions
@@ -0,0 +1,62 @@
import { IMessageDataWrapper } from '@nitrots/api';
export class PromoArticleData
{
public static readonly LINK_TYPE_URL = 0;
public static readonly LINK_TYPE_INTERNAL = 1;
public static readonly LINK_TYPE_NO_LINK = 2;
private _id: number;
private _title: string;
private _bodyText: string;
private _buttonText: string;
private _linkType: number;
private _linkContent: string;
private _imageUrl: string;
constructor(k: IMessageDataWrapper)
{
this._id = k.readInt();
this._title = k.readString();
this._bodyText = k.readString();
this._buttonText = k.readString();
this._linkType = k.readInt();
this._linkContent = k.readString();
this._imageUrl = k.readString();
}
public get id(): number
{
return this._id;
}
public get title(): string
{
return this._title;
}
public get bodyText(): string
{
return this._bodyText;
}
public get buttonText(): string
{
return this._buttonText;
}
public get linkType(): number
{
return this._linkType;
}
public get linkContent(): string
{
return this._linkContent;
}
public get imageUrl(): string
{
return this._imageUrl;
}
}
@@ -0,0 +1,32 @@
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
import { PromoArticleData } from './PromoArticleData';
export class PromoArticlesMessageParser implements IMessageParser
{
private _articles: PromoArticleData[];
public flush(): boolean
{
this._articles = [];
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
const count = wrapper.readInt();
for(let i = 0; i < count; i++)
{
this._articles.push(new PromoArticleData(wrapper));
}
return true;
}
public get articles(): PromoArticleData[]
{
return this._articles;
}
}
@@ -0,0 +1,3 @@
export * from './PromoArticleData';
export * from './PromoArticlesMessageParser';
export * from './votes';
@@ -0,0 +1,23 @@
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
export class CommunityVoteReceivedParser implements IMessageParser
{
private _acknowledged: boolean;
public flush(): boolean
{
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._acknowledged = wrapper.readBoolean();
return true;
}
public get acknowledged(): boolean
{
return this._acknowledged;
}
}
@@ -0,0 +1 @@
export * from './CommunityVoteReceivedParser';