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
Move to Renderer V2
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
export * from './ConfigurationEvent';
|
||||
export * from './MessageEvent';
|
||||
export * from './NitroEvent';
|
||||
export * from './SocketConnectionEvent';
|
||||
Reference in New Issue
Block a user