Interface HTResourceSlot

  • All Implemented Interfaces:
    hiiragi283.core.api.HTContentListener , hiiragi283.core.api.serialization.value.HTValueSerializable , hiiragi283.core.api.storage.amount.HTAmountView , hiiragi283.core.api.storage.resource.HTResourceView , java.lang.Runnable , net.neoforged.neoforge.common.util.INBTSerializable

    
    public interface HTResourceSlot<RESOURCE extends HTResourceType<?>>
     implements HTResourceView<RESOURCE>, HTValueSerializable, HTContentListener
                        

    リソースを搬入/搬出できることを表すインターフェースです。

    Since:

    0.1.0

    Author:

    Hiiragi Tsubasa

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public abstract class HTResourceSlot.Mutable
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Boolean isValid(RESOURCE resource) 指定したresourceが有効か判定します。
      abstract Integer insert(RESOURCE resource, Integer amount, HTStorageAction action, HTStorageAccess access) このスロットにリソースを搬入します。
      Integer extract(RESOURCE resource, Integer amount, HTStorageAction action, HTStorageAccess access) このスロットからリソースを搬出します。
      abstract Integer extract(Integer amount, HTStorageAction action, HTStorageAccess access) このスロットからリソースを搬出します。
      • Methods inherited from class hiiragi283.core.api.storage.resource.HTResourceView

        getCapacity, getCapacity, getLevelAsFloat, getLevelAsFraction, getNeeded, getResource, isEmpty
      • Methods inherited from class hiiragi283.core.api.storage.amount.HTAmountView

        getAmount, getLevelAsFloat, getLevelAsFraction, getNeeded
      • Methods inherited from class hiiragi283.core.api.serialization.value.HTValueSerializable

        deserialize, serialize
      • Methods inherited from class hiiragi283.core.api.HTContentListener

        onContentsChanged
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • insert

         abstract Integer insert(RESOURCE resource, Integer amount, HTStorageAction action, HTStorageAccess access)

        このスロットにリソースを搬入します。

        Parameters:
        resource - 搬入するリソース
        amount - 搬入する量
        action - 処理のフラグ
        access - このスロットへのアクセスの種類
        Returns:

        搬入されない数量

      • extract

         Integer extract(RESOURCE resource, Integer amount, HTStorageAction action, HTStorageAccess access)

        このスロットからリソースを搬出します。

        Parameters:
        resource - 搬出するリソース
        amount - 搬出する量
        action - 処理のフラグ
        access - このスロットへのアクセスの種類
        Returns:

        搬出される数量

      • extract

         abstract Integer extract(Integer amount, HTStorageAction action, HTStorageAccess access)

        このスロットからリソースを搬出します。

        Parameters:
        amount - 搬出する量
        action - 処理のフラグ
        access - このスロットへのアクセスの種類
        Returns:

        搬出される数量