mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-27 01:40:52 +01:00
Add doubles
This commit is contained in:
parent
0e8e291455
commit
69426ce0b5
@ -36,6 +36,15 @@ export class BinaryReader
|
|||||||
return short;
|
return short;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public readDouble(): number
|
||||||
|
{
|
||||||
|
const double = this._dataView.getFloat64(this._position);
|
||||||
|
|
||||||
|
this._position += 8;
|
||||||
|
|
||||||
|
return double;
|
||||||
|
}
|
||||||
|
|
||||||
public readInt(): number
|
public readInt(): number
|
||||||
{
|
{
|
||||||
const int = this._dataView.getInt32(this._position);
|
const int = this._dataView.getInt32(this._position);
|
||||||
@ -59,4 +68,4 @@ export class BinaryReader
|
|||||||
{
|
{
|
||||||
return this._dataView.buffer;
|
return this._dataView.buffer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,13 @@ export class EvaWireDataWrapper implements IMessageDataWrapper
|
|||||||
return this._buffer.readShort();
|
return this._buffer.readShort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public readDouble(): number
|
||||||
|
{
|
||||||
|
if(!this._buffer) return -1;
|
||||||
|
|
||||||
|
return this._buffer.readDouble();
|
||||||
|
}
|
||||||
|
|
||||||
public readInt(): number
|
public readInt(): number
|
||||||
{
|
{
|
||||||
if(!this._buffer) return -1;
|
if(!this._buffer) return -1;
|
||||||
@ -62,4 +69,4 @@ export class EvaWireDataWrapper implements IMessageDataWrapper
|
|||||||
{
|
{
|
||||||
return (this._buffer && (this._buffer.remaining() > 0));
|
return (this._buffer && (this._buffer.remaining() > 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,9 @@ export interface IMessageDataWrapper
|
|||||||
readBytes(length: number): BinaryReader;
|
readBytes(length: number): BinaryReader;
|
||||||
readBoolean(): boolean;
|
readBoolean(): boolean;
|
||||||
readShort(): number;
|
readShort(): number;
|
||||||
|
readDouble(): number;
|
||||||
readInt(): number;
|
readInt(): number;
|
||||||
readString(): string;
|
readString(): string;
|
||||||
header: number;
|
header: number;
|
||||||
bytesAvailable: boolean;
|
bytesAvailable: boolean;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user