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,24 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
import { Triggerable } from './Triggerable';
|
||||
|
||||
export class ConditionDefinition extends Triggerable
|
||||
{
|
||||
private _type: number;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
super(wrapper);
|
||||
|
||||
this._type = wrapper.readInt();
|
||||
}
|
||||
|
||||
public get type(): number
|
||||
{
|
||||
return this._type;
|
||||
}
|
||||
|
||||
public get code(): number
|
||||
{
|
||||
return this._type;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
import { Triggerable } from './Triggerable';
|
||||
|
||||
export class TriggerDefinition extends Triggerable
|
||||
{
|
||||
private _triggerConf: number;
|
||||
private _conflictingActions: number[];
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
super(wrapper);
|
||||
|
||||
this._conflictingActions = [];
|
||||
this._triggerConf = wrapper.readInt();
|
||||
|
||||
let count = wrapper.readInt();
|
||||
|
||||
while(count > 0)
|
||||
{
|
||||
this._conflictingActions.push(wrapper.readInt());
|
||||
|
||||
count--;
|
||||
}
|
||||
}
|
||||
|
||||
public get code(): number
|
||||
{
|
||||
return this._triggerConf;
|
||||
}
|
||||
|
||||
public get conflictingActions(): number[]
|
||||
{
|
||||
return this._conflictingActions;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
|
||||
export class Triggerable
|
||||
{
|
||||
private _stuffTypeSelectionEnabled: boolean;
|
||||
private _furniLimit: number;
|
||||
private _stuffIds: number[];
|
||||
private _id: number;
|
||||
private _stringParam: string;
|
||||
private _intParams: number[];
|
||||
private _stuffTypeId: number;
|
||||
private _stuffTypeSelectionCode: number;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
this._stuffIds = [];
|
||||
this._intParams = [];
|
||||
this._stuffTypeSelectionEnabled = wrapper.readBoolean();
|
||||
this._furniLimit = wrapper.readInt();
|
||||
|
||||
let count = wrapper.readInt();
|
||||
|
||||
while(count > 0)
|
||||
{
|
||||
this._stuffIds.push(wrapper.readInt());
|
||||
|
||||
count--;
|
||||
}
|
||||
|
||||
this._stuffTypeId = wrapper.readInt();
|
||||
this._id = wrapper.readInt();
|
||||
this._stringParam = wrapper.readString();
|
||||
|
||||
count = wrapper.readInt();
|
||||
|
||||
while(count > 0)
|
||||
{
|
||||
this._intParams.push(wrapper.readInt());
|
||||
|
||||
count--;
|
||||
}
|
||||
|
||||
this._stuffTypeSelectionCode = wrapper.readInt();
|
||||
}
|
||||
|
||||
public getBoolean(index: number): boolean
|
||||
{
|
||||
return (this._intParams[index] === 1);
|
||||
}
|
||||
|
||||
public get stuffTypeSelectionEnabled(): boolean
|
||||
{
|
||||
return this._stuffTypeSelectionEnabled;
|
||||
}
|
||||
|
||||
public get stuffTypeSelectionCode(): number
|
||||
{
|
||||
return this._stuffTypeSelectionCode;
|
||||
}
|
||||
|
||||
public set stuffTypeSelectionCode(k: number)
|
||||
{
|
||||
this._stuffTypeSelectionCode = k;
|
||||
}
|
||||
|
||||
public get maximumItemSelectionCount(): number
|
||||
{
|
||||
return this._furniLimit;
|
||||
}
|
||||
|
||||
public get selectedItems(): number[]
|
||||
{
|
||||
return this._stuffIds;
|
||||
}
|
||||
|
||||
public get id(): number
|
||||
{
|
||||
return this._id;
|
||||
}
|
||||
|
||||
public get stringData(): string
|
||||
{
|
||||
return this._stringParam;
|
||||
}
|
||||
|
||||
public get intData(): number[]
|
||||
{
|
||||
return this._intParams;
|
||||
}
|
||||
|
||||
public get code(): number
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public get spriteId(): number
|
||||
{
|
||||
return this._stuffTypeId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
import { Triggerable } from './Triggerable';
|
||||
|
||||
export class WiredActionDefinition extends Triggerable
|
||||
{
|
||||
private _type: number;
|
||||
private _delayInPulses: number;
|
||||
private _conflictingTriggers: number[];
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
super(wrapper);
|
||||
|
||||
this._conflictingTriggers = [];
|
||||
this._type = wrapper.readInt();
|
||||
this._delayInPulses = wrapper.readInt();
|
||||
|
||||
let count = wrapper.readInt();
|
||||
|
||||
while(count > 0)
|
||||
{
|
||||
this._conflictingTriggers.push(wrapper.readInt());
|
||||
|
||||
count--;
|
||||
}
|
||||
}
|
||||
|
||||
public get type(): number
|
||||
{
|
||||
return this._type;
|
||||
}
|
||||
|
||||
public get code(): number
|
||||
{
|
||||
return this._type;
|
||||
}
|
||||
|
||||
public get delayInPulses(): number
|
||||
{
|
||||
return this._delayInPulses;
|
||||
}
|
||||
|
||||
public get conflictingTriggers(): number[]
|
||||
{
|
||||
return this._conflictingTriggers;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { WiredActionDefinition } from './WiredActionDefinition';
|
||||
|
||||
export class WiredFurniActionParser implements IMessageParser
|
||||
{
|
||||
private _definition: WiredActionDefinition;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._definition = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._definition = new WiredActionDefinition(wrapper);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get definition(): WiredActionDefinition
|
||||
{
|
||||
return this._definition;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { ConditionDefinition } from './ConditionDefinition';
|
||||
|
||||
export class WiredFurniConditionParser implements IMessageParser
|
||||
{
|
||||
private _definition: ConditionDefinition;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._definition = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._definition = new ConditionDefinition(wrapper);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get definition(): ConditionDefinition
|
||||
{
|
||||
return this._definition;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { TriggerDefinition } from './TriggerDefinition';
|
||||
|
||||
export class WiredFurniTriggerParser implements IMessageParser
|
||||
{
|
||||
private _definition: TriggerDefinition;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._definition = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._definition = new TriggerDefinition(wrapper);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get definition(): TriggerDefinition
|
||||
{
|
||||
return this._definition;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class WiredOpenParser implements IMessageParser
|
||||
{
|
||||
private _stuffId: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._stuffId = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._stuffId = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get stuffId(): number
|
||||
{
|
||||
return this._stuffId;
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class WiredRewardResultMessageParser implements IMessageParser
|
||||
{
|
||||
private _reason: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._reason = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._reason = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get reason(): number
|
||||
{
|
||||
return this._reason;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class WiredSaveSuccessParser implements IMessageParser
|
||||
{
|
||||
public flush(): boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class WiredValidationErrorParser implements IMessageParser
|
||||
{
|
||||
private _info: string;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._info = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._info = wrapper.readString();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get info(): string
|
||||
{
|
||||
return this._info;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
export * from './ConditionDefinition';
|
||||
export * from './Triggerable';
|
||||
export * from './TriggerDefinition';
|
||||
export * from './WiredActionDefinition';
|
||||
export * from './WiredFurniActionParser';
|
||||
export * from './WiredFurniConditionParser';
|
||||
export * from './WiredFurniTriggerParser';
|
||||
export * from './WiredOpenParser';
|
||||
export * from './WiredRewardResultMessageParser';
|
||||
export * from './WiredSaveSuccessParser';
|
||||
export * from './WiredValidationErrorParser';
|
||||
Reference in New Issue
Block a user