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
Hiiragi Tsubasa
-
-
Method Summary
Modifier and Type Method Description abstract BooleanisValid(RESOURCE resource)指定したresourceが有効か判定します。 abstract Integerinsert(RESOURCE resource, Integer amount, HTStorageAction action, HTStorageAccess access)このスロットにリソースを搬入します。 Integerextract(RESOURCE resource, Integer amount, HTStorageAction action, HTStorageAccess access)このスロットからリソースを搬出します。 abstract Integerextract(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
-
-
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:
搬出される数量
-
-
-
-