You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-20 23:46:19 +00:00
Move to Renderer V2
This commit is contained in:
+47
@@ -0,0 +1,47 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class AvailabilityStatusMessageParser implements IMessageParser
|
||||
{
|
||||
private _isOpen: boolean;
|
||||
private _onShutdown: boolean;
|
||||
private _isAuthenticUser: boolean;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._isOpen = false;
|
||||
this._onShutdown = false;
|
||||
this._isAuthenticUser = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._isOpen = wrapper.readBoolean();
|
||||
this._onShutdown = wrapper.readBoolean();
|
||||
|
||||
if(wrapper.bytesAvailable)
|
||||
{
|
||||
this._isAuthenticUser = wrapper.readBoolean();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get isOpen(): boolean
|
||||
{
|
||||
return this._isOpen;
|
||||
}
|
||||
|
||||
public get onShutdown(): boolean
|
||||
{
|
||||
return this._onShutdown;
|
||||
}
|
||||
|
||||
public get isAuthenticUser(): boolean
|
||||
{
|
||||
return this._isAuthenticUser;
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class AvailabilityTimeMessageParser implements IMessageParser
|
||||
{
|
||||
private _isOpen: boolean;
|
||||
private _minutesUntilChange: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._isOpen = false;
|
||||
this._minutesUntilChange = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._isOpen = (wrapper.readInt() > 0);
|
||||
this._minutesUntilChange = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get isOpen(): boolean
|
||||
{
|
||||
return this._isOpen;
|
||||
}
|
||||
|
||||
public get minutesUntilChange(): number
|
||||
{
|
||||
return this._minutesUntilChange;
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class HotelClosedAndOpensMessageParser implements IMessageParser
|
||||
{
|
||||
private _openHour: number;
|
||||
private _openMinute: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._openHour = 0;
|
||||
this._openMinute = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._openHour = wrapper.readInt();
|
||||
this._openMinute = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get openHour(): number
|
||||
{
|
||||
return this._openHour;
|
||||
}
|
||||
|
||||
public get openMinute(): number
|
||||
{
|
||||
return this._openMinute;
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class HotelClosesAndWillOpenAtMessageParser implements IMessageParser
|
||||
{
|
||||
private _openHour: number;
|
||||
private _openMinute: number;
|
||||
private _userThrownOutAtClose: boolean;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._openHour = 0;
|
||||
this._openMinute = 0;
|
||||
this._userThrownOutAtClose = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._openHour = wrapper.readInt();
|
||||
this._openMinute = wrapper.readInt();
|
||||
this._userThrownOutAtClose = wrapper.readBoolean();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get openHour(): number
|
||||
{
|
||||
return this._openHour;
|
||||
}
|
||||
|
||||
public get openMinute(): number
|
||||
{
|
||||
return this._openMinute;
|
||||
}
|
||||
|
||||
public get userThrowOutAtClose(): boolean
|
||||
{
|
||||
return this._userThrownOutAtClose;
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class HotelWillCloseInMinutesMessageParser implements IMessageParser
|
||||
{
|
||||
private _minutes: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._minutes = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._minutes = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get openMinute(): number
|
||||
{
|
||||
return this._minutes;
|
||||
}
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class MaintenanceStatusMessageParser implements IMessageParser
|
||||
{
|
||||
private _isInMaintenance: boolean;
|
||||
private _minutesUntilMaintenance: number;
|
||||
private _duration: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._isInMaintenance = false;
|
||||
this._minutesUntilMaintenance = 0;
|
||||
this._duration = 15;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._isInMaintenance = wrapper.readBoolean();
|
||||
this._minutesUntilMaintenance = wrapper.readInt();
|
||||
|
||||
if(wrapper.bytesAvailable)
|
||||
{
|
||||
this._duration = wrapper.readInt();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get isInMaintenance(): boolean
|
||||
{
|
||||
return this._isInMaintenance;
|
||||
}
|
||||
|
||||
public get minutesUntilMaintenance(): number
|
||||
{
|
||||
return this._minutesUntilMaintenance;
|
||||
}
|
||||
|
||||
public get duration(): number
|
||||
{
|
||||
return this._duration;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export * from './AvailabilityStatusMessageParser';
|
||||
export * from './AvailabilityTimeMessageParser';
|
||||
export * from './HotelClosedAndOpensMessageParser';
|
||||
export * from './HotelClosesAndWillOpenAtMessageParser';
|
||||
export * from './HotelWillCloseInMinutesMessageParser';
|
||||
export * from './MaintenanceStatusMessageParser';
|
||||
Reference in New Issue
Block a user