Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package osv.model.content.playershops;
- public class ShopItem {
- private final int amount;
- private final int cost;
- private final int id;
- public ShopItem(int id, int amount, int cost) {
- super();
- this.id = id;
- this.amount = amount;
- this.cost = cost;
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- ShopItem other = (ShopItem) obj;
- if (id != other.id)
- return false;
- return other.amount >= amount;
- }
- public int getAmount() {
- return amount;
- }
- public int getCost() {
- return cost;
- }
- public int getId() {
- return id;
- }
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + amount;
- result = prime * result + cost;
- result = prime * result + id;
- return result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement