Implement ListTag

This commit is contained in:
zontreck 2024-05-04 22:44:04 -07:00
parent 4ee91e762a
commit dd133afd68
3 changed files with 88 additions and 50 deletions

View file

@ -10,6 +10,7 @@ import 'package:libac_flutter/nbt/impl/TagShort.dart';
import 'Stream.dart';
import 'impl/ByteTag.dart';
import 'impl/ListTag.dart';
enum TagType {
End(0),
@ -108,6 +109,26 @@ abstract class Tag {
{
return new IntArrayTag();
}
case TagType.List:
{
return new ListTag();
}
}
}
}
bool equals(dynamic object) {
if (object == null || !(object is Tag)) return false;
Tag tag = object;
if (tag.getType() != getType()) return false;
if (getKey() == null && tag.getKey() != null ||
tag.getKey() == null && getKey() != null) return false;
if (getKey() != null && !(getKey() == tag.getKey())) return false;
return true;
}
}