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