Drop of IntIntHolder class.

This commit is contained in:
MobiusDev
2018-08-10 18:32:32 +00:00
parent 7352425305
commit dcd734b447
16 changed files with 109 additions and 339 deletions

View File

@@ -438,7 +438,7 @@ public class L2SchemeBufferInstance extends L2FolkInstance
int fee = 0;
for (int sk : list)
{
fee += BufferTable.getInstance().getAvailableBuff(sk).getValue();
fee += BufferTable.getInstance().getAvailableBuff(sk).getPrice();
}
return fee;

View File

@@ -19,19 +19,31 @@ package com.l2jmobius.gameserver.model.holders;
/**
* A container used for schemes buffer.
*/
public final class BuffSkillHolder extends IntIntHolder
public final class BuffSkillHolder
{
private final int _id;
private final int _price;
private final String _type;
private final String _description;
public BuffSkillHolder(int id, int price, String type, String description)
{
super(id, price);
_id = id;
_price = price;
_type = type;
_description = description;
}
public int getId()
{
return _id;
}
public int getPrice()
{
return _price;
}
public final String getType()
{
return _type;

View File

@@ -16,54 +16,40 @@
*/
package com.l2jmobius.gameserver.model.holders;
import com.l2jmobius.gameserver.datatables.SkillTable;
import com.l2jmobius.gameserver.model.L2Skill;
/**
* A generic int/int container.
* A simple DTO for items; contains item ID and count.<br>
* @author UnAfraid
*/
public class IntIntHolder
public class ItemHolder
{
private int _id;
private int _value;
private final int _id;
private final long _count;
public IntIntHolder(int id, int value)
public ItemHolder(int id, long count)
{
_id = id;
_value = value;
_count = count;
}
/**
* @return the ID of the item contained in this object
*/
public int getId()
{
return _id;
}
public int getValue()
{
return _value;
}
public void setId(int id)
{
_id = id;
}
public void setValue(int value)
{
_value = value;
}
/**
* @return the L2Skill associated to the id/value.
* @return the count of items contained in this object
*/
public final L2Skill getSkill()
public long getCount()
{
return SkillTable.getInstance().getInfo(_id, _value);
return _count;
}
@Override
public String toString()
{
return getClass().getSimpleName() + ": Id: " + _id + ", Value: " + _value;
return "[" + getClass().getSimpleName() + "] ID: " + _id + ", count: " + _count;
}
}
}