mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-03-06 07:30:41 +07:00
Renamed readUnsigned15OrLess to readU15
This commit is contained in:
parent
70200c5521
commit
10f8945ddb
@ -140,7 +140,7 @@ public class BitStream {
|
||||
return (byte) readUnsigned(bits);
|
||||
}
|
||||
|
||||
public short readUnsigned15OrLess(int bits) {
|
||||
public short readU15(int bits) {
|
||||
assert bits < Short.SIZE : "only 15 bits can fit into short and be unsigned. bits: " + bits;
|
||||
return (short) readUnsigned(bits);
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ public class ItemSerializer {
|
||||
item.ilvl = bitStream.readU7(7);
|
||||
item.quality = Quality.valueOf(bitStream.readU7(4));
|
||||
item.pictureId = bitStream.readBoolean() ? bitStream.readU7(3) : Item.NO_PICTURE_ID;
|
||||
item.classOnly = bitStream.readBoolean() ? bitStream.readUnsigned15OrLess(11) : Item.NO_CLASS_ONLY;
|
||||
item.classOnly = bitStream.readBoolean() ? bitStream.readU15(11) : Item.NO_CLASS_ONLY;
|
||||
readQualityData(bitStream, item);
|
||||
|
||||
int listFlags = Item.MAGIC_PROPS_FLAG;
|
||||
@ -225,7 +225,7 @@ public class ItemSerializer {
|
||||
private static boolean readQuantity(BitStream bitStream, Item item) {
|
||||
boolean hasQuantity = item.base.stackable;
|
||||
if (hasQuantity) {
|
||||
int quantity = bitStream.readUnsigned15OrLess(9);
|
||||
int quantity = bitStream.readU15(9);
|
||||
item.props.base().put(Stat.quantity, quantity);
|
||||
}
|
||||
return hasQuantity;
|
||||
|
@ -78,7 +78,7 @@ public class PropertyList implements Iterable<Stat> {
|
||||
}
|
||||
|
||||
public PropertyList read(BitStream bitStream) {
|
||||
for (int prop; (prop = bitStream.readUnsigned15OrLess(Stat.BITS)) != Stat.NONE;) {
|
||||
for (int prop; (prop = bitStream.readU15(Stat.BITS)) != Stat.NONE;) {
|
||||
for (int j = prop, size = j + Stat.getNumEncoded(prop); j < size; j++) {
|
||||
read(j, bitStream);
|
||||
}
|
||||
|
@ -11,8 +11,8 @@ class RareQualityData {
|
||||
prefixes = new int[NUM_AFFIXES];
|
||||
suffixes = new int[NUM_AFFIXES];
|
||||
for (int i = 0; i < NUM_AFFIXES; i++) {
|
||||
prefixes[i] = bitStream.readBoolean() ? bitStream.readUnsigned15OrLess(Item.MAGIC_AFFIX_SIZE) : 0;
|
||||
suffixes[i] = bitStream.readBoolean() ? bitStream.readUnsigned15OrLess(Item.MAGIC_AFFIX_SIZE) : 0;
|
||||
prefixes[i] = bitStream.readBoolean() ? bitStream.readU15(Item.MAGIC_AFFIX_SIZE) : 0;
|
||||
suffixes[i] = bitStream.readBoolean() ? bitStream.readU15(Item.MAGIC_AFFIX_SIZE) : 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user