Interface HTResourceView
-
- All Implemented Interfaces:
-
hiiragi283.core.api.storage.amount.HTAmountView
public interface HTResourceView<RESOURCE extends HTResourceType<?>> implements HTAmountView
単一の不変のリソースを保持するインターフェースです。
- Since:
0.1.0
Hiiragi Tsubasa
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classHTResourceView.Mutable
-
Method Summary
Modifier and Type Method Description abstract RESOURCEgetResource()保持しているリソースを取得します。 abstract IntegergetCapacity(RESOURCE resource)指定したresourceから容量を取得します。 IntegergetCapacity()容量を返します。 IntegergetNeeded(RESOURCE resource)指定したresourceから空き容量を取得します。 FractiongetLevelAsFraction(RESOURCE resource)指定したresourceから占有率を取得します。 FloatgetLevelAsFloat(RESOURCE resource)占有率を返します。 BooleanisEmpty()このビューが空かどうか判定します。 -
-
Method Detail
-
getResource
abstract RESOURCE getResource()
保持しているリソースを取得します。
-
getCapacity
abstract Integer getCapacity(RESOURCE resource)
指定したresourceから容量を取得します。
-
getCapacity
Integer getCapacity()
容量を返します。
-
getLevelAsFraction
Fraction getLevelAsFraction(RESOURCE resource)
指定したresourceから占有率を取得します。
- Returns:
Fraction型での占有率
-
getLevelAsFloat
Float getLevelAsFloat(RESOURCE resource)
占有率を返します。
- Returns:
Float型での占有率
- Since:
v0.7.0
-
-
-
-