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;
|
||||
}
|
||||
|
||||
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);
|
||||
|
@ -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;
|
||||
|
@ -6,6 +6,7 @@ export interface IMessageDataWrapper
|
||||
readBytes(length: number): BinaryReader;
|
||||
readBoolean(): boolean;
|
||||
readShort(): number;
|
||||
readDouble(): number;
|
||||
readInt(): number;
|
||||
readString(): string;
|
||||
header: number;
|
||||
|
Loading…
Reference in New Issue
Block a user