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,12 @@
import { NitroEvent } from './NitroEvent';
export class ConfigurationEvent extends NitroEvent
{
public static LOADED: string = 'NCE_LOADED';
public static FAILED: string = 'NCE_FAILED';
constructor(type: string)
{
super(type);
}
}
+55
View File
@@ -0,0 +1,55 @@
import { IConnection, IMessageEvent, IMessageParser } from '@nitrots/api';
export class MessageEvent implements IMessageEvent
{
private _callBack: Function;
private _parserClass: Function;
private _parser: IMessageParser;
private _connection: IConnection;
constructor(callBack: Function, parser: { new(): IMessageParser })
{
this._callBack = callBack;
this._parserClass = parser;
this._parser = null;
this._connection = null;
}
public dispose(): void
{
this._callBack = null;
this._parserClass = null;
this._parser = null;
this._connection = null;
}
public get callBack(): Function
{
return this._callBack;
}
public get parserClass(): Function
{
return this._parserClass;
}
public get parser(): IMessageParser
{
return this._parser;
}
public set parser(parser: IMessageParser)
{
this._parser = parser;
}
public get connection(): IConnection
{
return this._connection;
}
public set connection(connection: IConnection)
{
this._connection = connection;
}
}
+16
View File
@@ -0,0 +1,16 @@
import { INitroEvent } from '@nitrots/api';
export class NitroEvent implements INitroEvent
{
private _type: string;
constructor(type: string)
{
this._type = type;
}
public get type(): string
{
return this._type;
}
}
@@ -0,0 +1,31 @@
import { IConnection } from '@nitrots/api';
import { NitroEvent } from './NitroEvent';
export class SocketConnectionEvent extends NitroEvent
{
public static CONNECTION_OPENED = 'SCE_OPEN';
public static CONNECTION_CLOSED = 'SCE_CLOSED';
public static CONNECTION_ERROR = 'SCE_ERROR';
public static CONNECTION_MESSAGE = 'SCE_MESSAGE';
private _connection: IConnection;
private _originalEvent: Event;
constructor(type: string, connection: IConnection, originalEvent: Event)
{
super(type);
this._connection = connection;
this._originalEvent = event;
}
public get connection(): IConnection
{
return this._connection;
}
public get originalEvent(): Event
{
return this._originalEvent;
}
}
+4
View File
@@ -0,0 +1,4 @@
export * from './ConfigurationEvent';
export * from './MessageEvent';
export * from './NitroEvent';
export * from './SocketConnectionEvent';