- java.lang.Object
-
- org.mal_lang.langspec.builders.AssetBuilder
-
-
Constructor Summary
Constructors Constructor Description AssetBuilder(String name, String category, boolean isAbstract, String superAsset)Constructs a newAssetBuilderobject.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AssetBuilderaddAttackStep(AttackStepBuilder attackStep)Adds an attack step to thisAssetBuilderobject.AssetBuilderaddVariable(VariableBuilder variable)Adds a variable to thisAssetBuilderobject.static AssetBuilderfromJson(JsonObject jsonAsset, Map<String,byte[]> svgIcons, Map<String,byte[]> pngIcons)Creates a newAssetBuilderfrom aJsonObject.List<AttackStepBuilder>getAttackSteps()Returns a list of all attack steps in thisAssetBuilderobject.StringgetCategory()Returns the category of thisAssetBuilderobject.MetaBuildergetMeta()Returns the meta info of thisAssetBuilderobject.StringgetName()Returns the name of thisAssetBuilderobject.byte[]getPngIcon()Returns the PNG icon of thisAssetBuilderobject, ornullif no PNG icon has been set.StringgetSuperAsset()Returns the super asset of thisAssetBuilderobject, ornullif no super asset has been set.byte[]getSvgIcon()Returns the SVG icon of thisAssetBuilderobject, ornullif no SVG icon has been set.List<VariableBuilder>getVariables()Returns a list of all variables in thisAssetBuilderobject.booleanisAbstract()Returns whether thisAssetBuilderobject is abstract.AssetBuildersetPngIcon(byte[] pngIcon)Sets the PNG icon of thisAssetBuilderobject.AssetBuildersetSvgIcon(byte[] svgIcon)Sets the SVG icon of thisAssetBuilderobject.
-
-
-
Constructor Detail
-
AssetBuilder
public AssetBuilder(String name, String category, boolean isAbstract, String superAsset)
Constructs a newAssetBuilderobject.- Parameters:
name- the name of the assetcategory- the category of the assetisAbstract- whether the asset is abstractsuperAsset- the super asset of the asset, ornull- Throws:
NullPointerException- ifnameorcategoryisnullIllegalArgumentException- ifnameorcategoryis not a valid identifier- Since:
- 1.0.0
-
-
Method Detail
-
getName
public String getName()
Returns the name of thisAssetBuilderobject.- Returns:
- the name of this
AssetBuilderobject - Since:
- 1.0.0
-
getMeta
public MetaBuilder getMeta()
Returns the meta info of thisAssetBuilderobject.- Returns:
- the meta info of this
AssetBuilderobject - Since:
- 1.0.0
-
getCategory
public String getCategory()
Returns the category of thisAssetBuilderobject.- Returns:
- the category of this
AssetBuilderobject - Since:
- 1.0.0
-
isAbstract
public boolean isAbstract()
Returns whether thisAssetBuilderobject is abstract.- Returns:
- whether this
AssetBuilderobject is abstract - Since:
- 1.0.0
-
getSuperAsset
public String getSuperAsset()
Returns the super asset of thisAssetBuilderobject, ornullif no super asset has been set.- Returns:
- the super asset of this
AssetBuilderobject, ornullif no super asset has been set - Since:
- 1.0.0
-
getVariables
public List<VariableBuilder> getVariables()
Returns a list of all variables in thisAssetBuilderobject.- Returns:
- a list of all variables in this
AssetBuilderobject - Since:
- 1.0.0
-
addVariable
public AssetBuilder addVariable(VariableBuilder variable)
Adds a variable to thisAssetBuilderobject.- Parameters:
variable- the variable to add- Returns:
- this
AssetBuilderobject - Throws:
NullPointerException- ifvariableisnull- Since:
- 1.0.0
-
getAttackSteps
public List<AttackStepBuilder> getAttackSteps()
Returns a list of all attack steps in thisAssetBuilderobject.- Returns:
- a list of all attack steps in this
AssetBuilderobject - Since:
- 1.0.0
-
addAttackStep
public AssetBuilder addAttackStep(AttackStepBuilder attackStep)
Adds an attack step to thisAssetBuilderobject.- Parameters:
attackStep- the attack step to add- Returns:
- this
AssetBuilderobject - Throws:
NullPointerException- ifattackStepisnull- Since:
- 1.0.0
-
getSvgIcon
public byte[] getSvgIcon()
Returns the SVG icon of thisAssetBuilderobject, ornullif no SVG icon has been set.- Returns:
- the SVG icon of this
AssetBuilderobject, ornullif no SVG icon has been set - Since:
- 1.0.0
-
setSvgIcon
public AssetBuilder setSvgIcon(byte[] svgIcon)
Sets the SVG icon of thisAssetBuilderobject.- Parameters:
svgIcon- the SVG icon to set- Returns:
- this
AssetBuilderobject - Throws:
NullPointerException- ifsvgIconisnull- Since:
- 1.0.0
-
getPngIcon
public byte[] getPngIcon()
Returns the PNG icon of thisAssetBuilderobject, ornullif no PNG icon has been set.- Returns:
- the PNG icon of this
AssetBuilderobject, ornullif no PNG icon has been set - Since:
- 1.0.0
-
setPngIcon
public AssetBuilder setPngIcon(byte[] pngIcon)
Sets the PNG icon of thisAssetBuilderobject.- Parameters:
pngIcon- the PNG icon to set- Returns:
- this
AssetBuilderobject - Throws:
NullPointerException- ifpngIconisnull- Since:
- 1.0.0
-
fromJson
public static AssetBuilder fromJson(JsonObject jsonAsset, Map<String,byte[]> svgIcons, Map<String,byte[]> pngIcons)
Creates a newAssetBuilderfrom aJsonObject.- Parameters:
jsonAsset- theJsonObjectsvgIcons- the SVG icons of the languagepngIcons- the PNG icons of the language- Returns:
- a new
AssetBuilderfrom aJsonObject - Throws:
NullPointerException- ifjsonAsset,svgIcons, orpngIconsisnull- Since:
- 1.0.0
-
-