Class SimpleInventoryState

java.lang.Object
org.cyclops.cyclopscore.inventory.SimpleInventoryState
All Implemented Interfaces:
IInventoryState

public class SimpleInventoryState extends Object implements IInventoryState
An inventory state implementation for a SimpleInventory.
  • Constructor Details

    • SimpleInventoryState

      public SimpleInventoryState(SimpleInventory inventory)
  • Method Details

    • getState

      public int getState()
      Description copied from interface: IInventoryState
      Get a state value which represents the current state of an inventory. This method must be able to calculate the state very quickly. Ideally, this should be pre-calculated. If inventory contents change, this method is guaranteed to return a different result. A different state does however not necessarily guarantee an inventory change but it should in most cases since callers might gate expensive logic behind hash changes.
      Specified by:
      getState in interface IInventoryState
      Returns:
      A value representing the current state of an inventory.