Addition of completeCount parameter for collections.
Thanks to nasseka.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -21,6 +21,7 @@
|
||||
<xs:attribute type="xs:integer" name="id" use="required" />
|
||||
<xs:attribute type="xs:integer" name="optionId" use="required" />
|
||||
<xs:attribute type="xs:integer" name="category" use="required" />
|
||||
<xs:attribute type="xs:long" name="completeCount" use="required" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
|
@@ -88,6 +88,7 @@ public class CollectionData implements IXmlReader
|
||||
final int id = parseInteger(attrs, "id");
|
||||
final int optionId = parseInteger(attrs, "optionId");
|
||||
final int category = parseInteger(attrs, "category");
|
||||
final long completeCount = parseLong(attrs, "completeCount", Long.MAX_VALUE);
|
||||
final List<ItemEnchantHolder> items = new ArrayList<>();
|
||||
for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling())
|
||||
{
|
||||
@@ -107,7 +108,7 @@ public class CollectionData implements IXmlReader
|
||||
}
|
||||
}
|
||||
|
||||
_collections.put(id, new CollectionDataHolder(id, optionId, category, items));
|
||||
_collections.put(id, new CollectionDataHolder(id, optionId, category, completeCount, items));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -14921,7 +14921,7 @@ public class Player extends Playable
|
||||
getCollections().stream().map(PlayerCollectionData::getCollectionId).collect(Collectors.toSet()).forEach(collectionId ->
|
||||
{
|
||||
final CollectionDataHolder collection = CollectionData.getInstance().getCollection(collectionId);
|
||||
if (getCollections().stream().filter(it -> it.getCollectionId() == collectionId).count() == collection.getItems().size())
|
||||
if (getCollections().stream().filter(it -> it.getCollectionId() == collectionId).count() >= collection.getCompleteCount())
|
||||
{
|
||||
final Options options = OptionData.getInstance().getOptions(collection.getOptionId());
|
||||
if (options != null)
|
||||
|
@@ -26,13 +26,15 @@ public class CollectionDataHolder
|
||||
private final int _collectionId;
|
||||
private final int _optionId;
|
||||
private final int _category;
|
||||
private final long _completeCount;
|
||||
private final List<ItemEnchantHolder> _items;
|
||||
|
||||
public CollectionDataHolder(int collectionId, int optionId, int category, List<ItemEnchantHolder> items)
|
||||
public CollectionDataHolder(int collectionId, int optionId, int category, long completeCount, List<ItemEnchantHolder> items)
|
||||
{
|
||||
_collectionId = collectionId;
|
||||
_optionId = optionId;
|
||||
_category = category;
|
||||
_completeCount = completeCount;
|
||||
_items = items;
|
||||
}
|
||||
|
||||
@@ -51,6 +53,11 @@ public class CollectionDataHolder
|
||||
return _category;
|
||||
}
|
||||
|
||||
public long getCompleteCount()
|
||||
{
|
||||
return _completeCount;
|
||||
}
|
||||
|
||||
public List<ItemEnchantHolder> getItems()
|
||||
{
|
||||
return _items;
|
||||
|
Reference in New Issue
Block a user