Implement DoubleTag
This commit is contained in:
parent
70f6e16d17
commit
0bf1e2b2d9
2 changed files with 19 additions and 5 deletions
|
@ -1,18 +1,27 @@
|
|||
import 'package:libac_flutter/nbt/Stream.dart';
|
||||
import 'package:libac_flutter/nbt/Tag.dart';
|
||||
|
||||
class TagDouble extends Tag {
|
||||
final double value;
|
||||
TagDouble({required this.value});
|
||||
class DoubleTag extends Tag {
|
||||
double _value = 0.0;
|
||||
|
||||
DoubleTag();
|
||||
|
||||
DoubleTag._(double value) {
|
||||
_value = value;
|
||||
}
|
||||
|
||||
static DoubleTag valueOf(double value) {
|
||||
return DoubleTag._(value);
|
||||
}
|
||||
|
||||
@override
|
||||
void readValue(ByteLayer data) {
|
||||
// TODO: implement readValue
|
||||
_value = data.readDouble();
|
||||
}
|
||||
|
||||
@override
|
||||
void writeValue(ByteLayer data) {
|
||||
// TODO: implement writeValue
|
||||
data.writeDouble(_value);
|
||||
}
|
||||
|
||||
@override
|
Loading…
Add table
Add a link
Reference in a new issue