Class Shop


  • public class Shop
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void add​(int index, Item t)  
      static boolean add​(Item t)  
      static java.util.List<Item> all()  
      static java.util.List<Item> all​(Filter<Item> filter)
      A list of all the filtered items.
      static int capacity()  
      static boolean close()
      Closes the shop interface.
      static boolean contains​(int id)
      Checks if the Shop contains an Item with the given id
      static boolean contains​(int[] ids)  
      static boolean contains​(java.lang.Integer... ids)
      Checks if the Shop contains at least one item which meets one of the specified ids.
      static boolean contains​(java.lang.Object o)
      Checks if the Shop contains an Item matching the given Object Object could be Integer, String, Filter, or a given Item Logs an error if object type is not supported.
      static boolean contains​(java.lang.String string)
      Determines if the Shop contains item with specified name.
      static boolean contains​(java.lang.String... names)
      Checks if the Shop contains at least one item which meets one of the specified names.
      static boolean contains​(Filter<Item> filter)
      Checks if the SHop contains at least one item which meets the specified filter.
      static boolean containsAll​(int[] ids)
      Checks if the Shop contains all the items with specified IDs
      static boolean containsAll​(java.lang.Integer... ids)
      static boolean containsAll​(java.lang.String... names)
      Checks if the Shop contains all the items with names specified
      static boolean containsAll​(java.util.Collection<?> collection)
      Checks if the Shop contains all the items that match everything in the given collection Uses contains(Object)
      static int count​(int id)
      Count of the item that matches the given id.
      static int count​(int[] ids)
      The total count of all the items that match the given ids
      static int count​(java.lang.Integer... ids)
      static int count​(java.lang.String name)
      Count of the item that matches the given name
      static int count​(java.lang.String... names)
      Count of all the items that match the given names
      static int count​(Filter<Item> filter)
      Count of all the items that match the filter.
      static int emptySlotCount()
      Empty slot count.
      static java.util.List<Item> except​(Filter<Item> filter)
      Get all items which do not fit the given criteria.
      static int fullSlotCount()
      Full slot count.
      static Item get​(int id)
      Gets the first Item matching the given ID
      static Item get​(int[] ids)
      static Item get​(java.lang.Integer... ids)
      Gets the first Item matching the given IDs
      static Item get​(java.lang.String name)
      Get item for specified name.
      static Item get​(java.lang.String... names)
      Get the first item that matches one of the given names
      static Item get​(Filter<Item> filter)
      Gets the first item that matches the given filter
      static int getFirstEmptySlot()
      Gets the first empty slot in the Shop.
      static int getFirstFullSlot()
      Gets the next full slot in the Shop
      static int getIdForSlot​(int slot)
      Gets the Id of the Item in the slot.
      static Item getItemInSlot​(int index)
      Gets item in the specified slot.
      static java.lang.String getNameForSlot​(int slot)
      Gets the Name for the Item in the slot.
      static Widget getParent()
      Gets parent widget for current shop.
      static java.awt.Rectangle getSlotBounds​(int slot)
      Gets a Rectangle of the Item's slot
      static java.awt.Rectangle getSlotBounds​(Item item)
      Gets a Rectangle of the Item's slot
      static java.lang.String getTitle()
      Gets the title of the current shop widget.
      static boolean interact​(Filter<Item> filter, java.lang.String action)
      Interacts with an Item in the shop
      static boolean isEmpty()  
      static boolean isFull()
      Determines if Shop full.
      static boolean isOpen()
      Determines if a shop widget is open.
      static boolean isSlotEmpty​(int slot)  
      static boolean isSlotFull​(int slot)
      Checks if the slot has an Item in it
      static boolean onlyContains​(int[] id)  
      static boolean onlyContains​(java.lang.Integer... id)
      Checks if the shop only contains items with specified ID
      static boolean onlyContains​(java.lang.String... names)
      Checks if the shop only contains items with specified name
      static boolean onlyContains​(Filter<Item> f)
      Checks if the shop only contains items that match the Filter
      static boolean open()  
      static boolean open​(int shopId)  
      static boolean open​(java.lang.String shopName)  
      static boolean purchase​(int id, int amount)
      Buys an item from the store with an adjustable amount.
      static boolean purchase​(java.lang.String name, int amount)
      Buys an item from the shop with an adjustable amount.
      static boolean purchase​(Filter<Item> filter, int amount)
      Buys an item from the shop with an adjustable amount.
      static boolean purchase​(Item item, int amount)
      Buys an item from the shop with an adjustable amount.
      static boolean purchaseFifty​(int id)
      Purchases fifty of the Item
      static boolean purchaseFifty​(java.lang.String name)
      Purchases fifty of the Item
      static boolean purchaseFifty​(Filter<Item> filter)
      Purchases fifty of the Item
      static boolean purchaseFifty​(Item item)
      Purchases fifty of the Item
      static boolean purchaseFive​(int id)
      Purchases five of the Item
      static boolean purchaseFive​(java.lang.String name)
      Purchases five of the Item
      static boolean purchaseFive​(Filter<Item> filter)
      Purchases five of the Item
      static boolean purchaseFive​(Item item)
      Purchases five of the Item
      static boolean purchaseOne​(int id)
      Purchases one of the Item
      static boolean purchaseOne​(java.lang.String name)
      Purchases one of the Item
      static boolean purchaseOne​(Filter<Item> filter)
      Purchases one of the Item
      static boolean purchaseOne​(Item item)
      Purchases one of the Item
      static boolean purchaseTen​(int id)
      Purchases ten of the Item
      static boolean purchaseTen​(java.lang.String name)
      Purchases ten of the Item
      static boolean purchaseTen​(Filter<Item> filter)
      Purchases ten of the Item
      static boolean purchaseTen​(Item item)
      Purchases ten of the Item
      static boolean sell​(int id, int amount)
      Sells an item from your inventory with an adjustable amount.
      static boolean sell​(java.lang.String name, int amount)
      Sells an item from your inventory with an adjustable amount.
      static boolean sell​(Filter<Item> filter, int amount)
      Sells an item from your inventory with an adjustable amount.
      static boolean sell​(Item item, int amount)
      Sells an item from your inventory with an adjustable amount.
      static boolean sellFifty​(int id)
      Sells fifty of the Item
      static boolean sellFifty​(java.lang.String name)
      Sells fifty of the Item
      static boolean sellFifty​(Filter<Item> filter)
      Sells fifty of the Item
      static boolean sellFifty​(Item item)
      Sells fifty of the item.
      static boolean sellFive​(int id)
      Sells five of the Item
      static boolean sellFive​(java.lang.String name)
      Sells five of the Item
      static boolean sellFive​(Filter<Item> filter)
      Sells five of the Item
      static boolean sellFive​(Item item)
      Sells five of the item.
      static boolean sellOne​(int id)
      Sells one of the Item
      static boolean sellOne​(java.lang.String name)
      Sells one of the Item
      static boolean sellOne​(Filter<Item> filter)
      Sells one of the Item
      static boolean sellOne​(Item item)
      Sells one of the Item
      static boolean sellTen​(int id)
      Sells ten of the Item
      static boolean sellTen​(java.lang.String name)
      Sells ten of the Item
      static boolean sellTen​(Filter<Item> filter)
      Sells ten of the Item
      static boolean sellTen​(Item item)
      Sells ten of the item.
      static Item set​(int index, Item element)  
      static int size()  
      static int slot​(int id)
      Gets the slot for the item with the specified ID.
      static int slot​(java.lang.String name)
      Gets the slot for the item with the specified name.
      static int slot​(Filter<Item> filter)
      Gets the slot for the item that matches the given Filter
      static boolean slotContains​(int slot, int[] ids)
      static boolean slotContains​(int slot, java.lang.Integer... ids)
      Checks if the slot contains an item that matches one of the given ids
      static boolean slotContains​(int slot, java.lang.String... names)
      Checks if the slot contains an item that matches the given names.
      static boolean slotContains​(int slot, Filter<Item> filter)
      Checks if the slot contains an item that matches the filter.
      static boolean slotContains​(int slot, Item t)
      Checks if the slot contains the given Item
      static boolean slotNameContains​(int slot, java.lang.String sub)
      Checks if the slot contains an item that matches the given name
      static java.lang.Object[] toArray()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • capacity

        public static int capacity()
      • all

        public static java.util.List<Item> all()
      • isOpen

        public static boolean isOpen()
        Determines if a shop widget is open.
        Returns:
        true if open, otherwise false.
      • open

        public static boolean open()
      • open

        public static boolean open​(java.lang.String shopName)
      • open

        public static boolean open​(int shopId)
      • close

        public static boolean close()
        Closes the shop interface.
        Returns:
        True if shop interface is closed, else False
      • getTitle

        public static java.lang.String getTitle()
        Gets the title of the current shop widget.
        Returns:
        the widget shop title if valid, otherwise "null".
      • getParent

        public static Widget getParent()
        Gets parent widget for current shop.
        Returns:
        the parent widget of the current shop if open, otherwise null.
      • getSlotBounds

        public static java.awt.Rectangle getSlotBounds​(Item item)
        Gets a Rectangle of the Item's slot
        Parameters:
        item - Item to get bounds of
        Returns:
        Rectangle of the Item's slot position
      • getSlotBounds

        public static java.awt.Rectangle getSlotBounds​(int slot)
        Gets a Rectangle of the Item's slot
        Parameters:
        slot - slot to get bounds of
        Returns:
        Rectangle of the Item's slot position
      • sell

        public static boolean sell​(int id,
                                   int amount)
        Sells an item from your inventory with an adjustable amount.
        Parameters:
        id - the id of the item you wish to sell.
        amount - the amount you wish to sell
        Returns:
        true if interaction was successful, false if item isn't in inventory or fails to sell.
      • sell

        public static boolean sell​(java.lang.String name,
                                   int amount)
        Sells an item from your inventory with an adjustable amount.
        Parameters:
        name - the name of the item you wish to sell.
        amount - the amount you wish to sell
        Returns:
        true if interaction was successful, false if item isn't in inventory or fails to sell.
      • sell

        public static boolean sell​(Item item,
                                   int amount)
        Sells an item from your inventory with an adjustable amount.
        Parameters:
        item - the item you wish to sell.
        amount - the amount you wish to sell
        Returns:
        true if interaction was successful, false if item isn't in inventory or fails to sell.
      • sell

        public static boolean sell​(Filter<Item> filter,
                                   int amount)
        Sells an item from your inventory with an adjustable amount.
        Parameters:
        filter - Filter used to find item to sell.
        amount - the amount you wish to sell
        Returns:
        true if interaction was successful, false if item isn't in inventory or fails to sell.
      • purchase

        public static boolean purchase​(int id,
                                       int amount)
        Buys an item from the store with an adjustable amount.
        Parameters:
        id - the id of the item you wish to buy.
        amount - the amount you wish to buy.
        Returns:
        true if interaction was successful, false if item isn't in inventory or fails to buy.
      • purchase

        public static boolean purchase​(java.lang.String name,
                                       int amount)
        Buys an item from the shop with an adjustable amount.
        Parameters:
        name - the name of the item you wish to buy.
        amount - the amount you wish to buy.
        Returns:
        true if interaction was successful, false if item isn't in inventory or fails to buy.
      • purchase

        public static boolean purchase​(Item item,
                                       int amount)
        Buys an item from the shop with an adjustable amount.
        Parameters:
        item - the item you wish to buy.
        amount - the amount you wish to buy.
        Returns:
        true if interaction was successful, false if item isn't in inventory or fails to buy.
      • purchase

        public static boolean purchase​(Filter<Item> filter,
                                       int amount)
        Buys an item from the shop with an adjustable amount.
        Parameters:
        filter - Filter used to find item to buy.
        amount - the amount you wish to buy.
        Returns:
        true if interaction was successful, false if item isn't in inventory or fails to buy.
      • sellOne

        public static boolean sellOne​(int id)
        Sells one of the Item
        Parameters:
        id - ID of the item to sell
        Returns:
        true if interaction is successful, else False
      • sellOne

        public static boolean sellOne​(java.lang.String name)
        Sells one of the Item
        Parameters:
        name - name of the item to sell
        Returns:
        true if interaction is successful, else False
      • sellOne

        public static boolean sellOne​(Filter<Item> filter)
        Sells one of the Item
        Parameters:
        filter - Filter used to find item to sell
        Returns:
        true if interaction is successful, else False
      • sellOne

        public static boolean sellOne​(Item item)
        Sells one of the Item
        Parameters:
        item - Item which you want to sell
        Returns:
        true if interaction is successful, otherwise false
      • sellFive

        public static boolean sellFive​(int id)
        Sells five of the Item
        Parameters:
        id - ID of the item to sell
        Returns:
        true if interaction is successful, else False
      • sellFive

        public static boolean sellFive​(java.lang.String name)
        Sells five of the Item
        Parameters:
        name - name of the item to sell
        Returns:
        true if interaction is successful, else False
      • sellFive

        public static boolean sellFive​(Item item)
        Sells five of the item.
        Parameters:
        item - Item which you want to sell
        Returns:
        true if interaction is successful, otherwise false
      • sellFive

        public static boolean sellFive​(Filter<Item> filter)
        Sells five of the Item
        Parameters:
        filter - Filter used to find item to sell
        Returns:
        true if interaction is successful, else False
      • sellTen

        public static boolean sellTen​(int id)
        Sells ten of the Item
        Parameters:
        id - ID of the item to sell
        Returns:
        true if interaction is successful, else False
      • sellTen

        public static boolean sellTen​(java.lang.String name)
        Sells ten of the Item
        Parameters:
        name - name of the item to sell
        Returns:
        true if interaction is successful, else False
      • sellTen

        public static boolean sellTen​(Filter<Item> filter)
        Sells ten of the Item
        Parameters:
        filter - Filter used to find item to sell
        Returns:
        true if interaction is successful, else False
      • sellTen

        public static boolean sellTen​(Item item)
        Sells ten of the item.
        Parameters:
        item - Item which you want to sell
        Returns:
        true if interaction is successful, otherwise false
      • sellFifty

        public static boolean sellFifty​(int id)
        Sells fifty of the Item
        Parameters:
        id - ID of the item to sell
        Returns:
        true if interaction is successful, else False
      • sellFifty

        public static boolean sellFifty​(java.lang.String name)
        Sells fifty of the Item
        Parameters:
        name - name of the item to sell
        Returns:
        true if interaction is successful, else False
      • sellFifty

        public static boolean sellFifty​(Filter<Item> filter)
        Sells fifty of the Item
        Parameters:
        filter - Filter used to find item to sell
        Returns:
        true if interaction is successful, else False
      • sellFifty

        public static boolean sellFifty​(Item item)
        Sells fifty of the item.
        Parameters:
        item - Item which you want to sell
        Returns:
        true if interaction is successful, otherwise false
      • purchaseOne

        public static boolean purchaseOne​(int id)
        Purchases one of the Item
        Parameters:
        id - ID of the item to purchase
        Returns:
        true if interaction is successful, else False
      • purchaseOne

        public static boolean purchaseOne​(java.lang.String name)
        Purchases one of the Item
        Parameters:
        name - name of the item to purchase
        Returns:
        true if interaction is successful, else False
      • purchaseOne

        public static boolean purchaseOne​(Item item)
        Purchases one of the Item
        Parameters:
        item - Item which you want to purchase.
        Returns:
        true if interaction is successful, otherwise false.
      • purchaseOne

        public static boolean purchaseOne​(Filter<Item> filter)
        Purchases one of the Item
        Parameters:
        filter - Filter used to find item to purchase.
        Returns:
        true if interaction is successful, else False
      • purchaseFive

        public static boolean purchaseFive​(int id)
        Purchases five of the Item
        Parameters:
        id - ID of the item to purchase
        Returns:
        true if interaction is successful, else False
      • purchaseFive

        public static boolean purchaseFive​(java.lang.String name)
        Purchases five of the Item
        Parameters:
        name - name of the item to purchase
        Returns:
        true if interaction is successful, else False
      • purchaseFive

        public static boolean purchaseFive​(Item item)
        Purchases five of the Item
        Parameters:
        item - Item which you want to purchase.
        Returns:
        true if interaction is successful, otherwise false.
      • purchaseFive

        public static boolean purchaseFive​(Filter<Item> filter)
        Purchases five of the Item
        Parameters:
        filter - Filter used to find item to purchase.
        Returns:
        true if interaction is successful, else False
      • purchaseTen

        public static boolean purchaseTen​(int id)
        Purchases ten of the Item
        Parameters:
        id - ID of the item to purchase
        Returns:
        true if interaction is successful, else False
      • purchaseTen

        public static boolean purchaseTen​(java.lang.String name)
        Purchases ten of the Item
        Parameters:
        name - name of the item to purchase
        Returns:
        true if interaction is successful, else False
      • purchaseTen

        public static boolean purchaseTen​(Item item)
        Purchases ten of the Item
        Parameters:
        item - Item which you want to purchase.
        Returns:
        true if interaction is successful, otherwise false.
      • purchaseTen

        public static boolean purchaseTen​(Filter<Item> filter)
        Purchases ten of the Item
        Parameters:
        filter - Filter used to find item to purchase.
        Returns:
        true if interaction is successful, else False
      • purchaseFifty

        public static boolean purchaseFifty​(int id)
        Purchases fifty of the Item
        Parameters:
        id - ID of the item to purchase
        Returns:
        true if interaction is successful, else False
      • purchaseFifty

        public static boolean purchaseFifty​(java.lang.String name)
        Purchases fifty of the Item
        Parameters:
        name - name of the item to purchase
        Returns:
        true if interaction is successful, else False
      • purchaseFifty

        public static boolean purchaseFifty​(Item item)
        Purchases fifty of the Item
        Parameters:
        item - Item which you want to purchase.
        Returns:
        true if interaction is successful, otherwise false.
      • purchaseFifty

        public static boolean purchaseFifty​(Filter<Item> filter)
        Purchases fifty of the Item
        Parameters:
        filter - Filter used to find item to purchase.
        Returns:
        true if interaction is successful, else False
      • interact

        public static boolean interact​(Filter<Item> filter,
                                       java.lang.String action)
        Interacts with an Item in the shop
        Parameters:
        filter - The item filter used to find the item you wish to interact with.
        action - The action you wish to be performed
        Returns:
        true if interaction was successful, else False
      • fullSlotCount

        public static int fullSlotCount()
        Full slot count.
        Returns:
        the count of full slots as a int.
      • emptySlotCount

        public static int emptySlotCount()
        Empty slot count.
        Returns:
        the count of empty slots as a int.
      • isSlotEmpty

        public static boolean isSlotEmpty​(int slot)
      • isSlotFull

        public static boolean isSlotFull​(int slot)
        Checks if the slot has an Item in it
        Parameters:
        slot - slot to check
        Returns:
        True if there's an item there, else False
      • onlyContains

        public static boolean onlyContains​(java.lang.String... names)
        Checks if the shop only contains items with specified name
        Parameters:
        names - Names of items to look for
        Returns:
        True if Shop only contains items with that name, else False
      • onlyContains

        public static boolean onlyContains​(java.lang.Integer... id)
        Checks if the shop only contains items with specified ID
        Parameters:
        id - IDs of items to check for
        Returns:
        True if Shop only contains items with specified ID, else False
      • onlyContains

        public static boolean onlyContains​(int[] id)
      • onlyContains

        public static boolean onlyContains​(Filter<Item> f)
        Checks if the shop only contains items that match the Filter
        Parameters:
        f - Filter to pass items through
        Returns:
        True if Shop only contains items matching Filter, else False
      • slotContains

        public static boolean slotContains​(int slot,
                                           java.lang.String... names)
        Checks if the slot contains an item that matches the given names.
        Parameters:
        names - names of the items to check
        Returns:
        true if the slot matches one of the given names, else false
      • slotNameContains

        public static boolean slotNameContains​(int slot,
                                               java.lang.String sub)
        Checks if the slot contains an item that matches the given name
        Parameters:
        sub - the substring which will be used to search.
        Returns:
        True if Shop only contains an item with the given name, else false.
      • slotContains

        public static boolean slotContains​(int slot,
                                           java.lang.Integer... ids)
        Checks if the slot contains an item that matches one of the given ids
        Parameters:
        ids - ids of the items to check.
        Returns:
        True if Shop slot contains an item with one of the given ids
      • slotContains

        public static boolean slotContains​(int slot,
                                           Item t)
        Checks if the slot contains the given Item
        Parameters:
        t - The Item to check for
        Returns:
        True if Shop slot contains the given Item, else false.
      • slotContains

        public static boolean slotContains​(int slot,
                                           Filter<Item> filter)
        Checks if the slot contains an item that matches the filter.
        Parameters:
        filter - Filter to pass items through.
        Returns:
        True if Shop slot contains an item matching Filter, else false.
      • getFirstEmptySlot

        public static int getFirstEmptySlot()
        Gets the first empty slot in the Shop.
        Returns:
        slot number, if Shop is full -1.
      • getFirstFullSlot

        public static int getFirstFullSlot()
        Gets the next full slot in the Shop
        Returns:
        slot number, if Shop is empty -1
      • getIdForSlot

        public static int getIdForSlot​(int slot)
        Gets the Id of the Item in the slot.
        Parameters:
        slot - Slot to get item id of.
        Returns:
        Item ID or -1 if no item.
      • getNameForSlot

        public static java.lang.String getNameForSlot​(int slot)
        Gets the Name for the Item in the slot.
        Parameters:
        slot - Slot to get item name of.
        Returns:
        Item name or "" if item is null.
      • slot

        public static int slot​(int id)
        Gets the slot for the item with the specified ID.
        Parameters:
        id - ID of item to get slot of.
        Returns:
        Item slot or -1 if Item is null.
      • slot

        public static int slot​(java.lang.String name)
        Gets the slot for the item with the specified name.
        Parameters:
        name - Name of item to get slot of.
        Returns:
        Item slot or -1 if Item is null.
      • slot

        public static int slot​(Filter<Item> filter)
        Gets the slot for the item that matches the given Filter
        Parameters:
        filter - filter of the item to get slot of.
        Returns:
        Item slot or -1 if Item is null.
      • add

        public static boolean add​(Item t)
      • toArray

        public static java.lang.Object[] toArray()
      • add

        public static void add​(int index,
                               Item t)
      • all

        public static java.util.List<Item> all​(Filter<Item> filter)
        A list of all the filtered items.
        Parameters:
        filter - the filter to search with.
        Returns:
        the list of all filtered items.
      • getItemInSlot

        public static Item getItemInSlot​(int index)
        Gets item in the specified slot.
        Parameters:
        index - the index of the slot.
        Returns:
        the item in slot.
      • get

        public static Item get​(int id)
        Gets the first Item matching the given ID
        Parameters:
        id - ID of the item to look for
        Returns:
        first Item with given ID or null if not found
      • get

        public static Item get​(java.lang.Integer... ids)
        Gets the first Item matching the given IDs
        Parameters:
        ids - IDs of the items to look for
        Returns:
        first Item that matches one of the given IDs or null if not found
      • get

        public static Item get​(java.lang.String name)
        Get item for specified name.
        Parameters:
        name - the name of the item.
        Returns:
        the item if the list contains it, otherwise null.
      • get

        public static Item get​(java.lang.String... names)
        Get the first item that matches one of the given names
        Parameters:
        names - the names of the items to look for.
        Returns:
        the first Item that matches one of the given names, or null if not found
      • get

        public static Item get​(Filter<Item> filter)
        Gets the first item that matches the given filter
        Parameters:
        filter - filter of the items to look for
        Returns:
        The first item that matches the given filter, else null if not found
      • except

        public static java.util.List<Item> except​(Filter<Item> filter)
        Get all items which do not fit the given criteria.
        Parameters:
        filter - The filter of the items to ignore.
        Returns:
        The list of items found which do not match the given criteria.
      • size

        public static int size()
      • isEmpty

        public static boolean isEmpty()
      • contains

        public static boolean contains​(int id)
        Checks if the Shop contains an Item with the given id
        Parameters:
        id - the id of the Item
        Returns:
        true if contains, else false
      • contains

        public static boolean contains​(java.lang.String string)
        Determines if the Shop contains item with specified name.
        Parameters:
        string - the name of the item.
        Returns:
        true if the collection contains item, otherwise false.
      • containsAll

        public static boolean containsAll​(java.lang.String... names)
        Checks if the Shop contains all the items with names specified
        Parameters:
        names - Names of items to check for
        Returns:
        True if Shop contains all names, else False
      • containsAll

        public static boolean containsAll​(int[] ids)
        Checks if the Shop contains all the items with specified IDs
        Parameters:
        ids - IDs of items to check for
        Returns:
        True if Shop contains all IDs, else false.
      • containsAll

        public static boolean containsAll​(java.lang.Integer... ids)
      • containsAll

        public static boolean containsAll​(java.util.Collection<?> collection)
        Checks if the Shop contains all the items that match everything in the given collection Uses contains(Object)
        Parameters:
        collection - Collection of matches to check for
        Returns:
        True if Shop contains everything in the given collection, else false
      • contains

        public static boolean contains​(java.lang.Integer... ids)
        Checks if the Shop contains at least one item which meets one of the specified ids.
        Parameters:
        ids - Item IDs to check for
        Returns:
        True if contains at least one of, else false
      • contains

        public static boolean contains​(int[] ids)
      • contains

        public static boolean contains​(java.lang.String... names)
        Checks if the Shop contains at least one item which meets one of the specified names.
        Parameters:
        names - names to check for
        Returns:
        true if contains at least one of, else false.
      • contains

        public static boolean contains​(Filter<Item> filter)
        Checks if the SHop contains at least one item which meets the specified filter.
        Parameters:
        filter - the filter to search with.
        Returns:
        true if contains at least one of, else false.
      • contains

        public static boolean contains​(java.lang.Object o)
        Checks if the Shop contains an Item matching the given Object Object could be Integer, String, Filter, or a given Item Logs an error if object type is not supported.
        Parameters:
        o - Object to check for
        Returns:
        True if contains, else false if not contains or if unsupported Object
      • isFull

        public static boolean isFull()
        Determines if Shop full.
        Returns:
        true if full, else false
      • count

        public static int count​(java.lang.String name)
        Count of the item that matches the given name
        Parameters:
        name - the name of the item.
        Returns:
        the total count of the item with the given name.
      • count

        public static int count​(java.lang.String... names)
        Count of all the items that match the given names
        Parameters:
        names - Names of the items to count
        Returns:
        the total count of all the items matching the given names
      • count

        public static int count​(int id)
        Count of the item that matches the given id.
        Parameters:
        id - the id of the item to count.
        Returns:
        the total count of the Item with the given id
      • count

        public static int count​(int[] ids)
        The total count of all the items that match the given ids
        Parameters:
        ids - ids of the items to count
        Returns:
        The total count of all the items with the given ids
      • count

        public static int count​(java.lang.Integer... ids)
      • count

        public static int count​(Filter<Item> filter)
        Count of all the items that match the filter.
        Parameters:
        filter - the filter of the Items to count
        Returns:
        the total count of matching items.
      • set

        public static Item set​(int index,
                               Item element)