- 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 newAssetBuilder
object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AssetBuilder
addAttackStep(AttackStepBuilder attackStep)
Adds an attack step to thisAssetBuilder
object.AssetBuilder
addVariable(VariableBuilder variable)
Adds a variable to thisAssetBuilder
object.static AssetBuilder
fromJson(JsonObject jsonAsset, Map<String,byte[]> svgIcons, Map<String,byte[]> pngIcons)
Creates a newAssetBuilder
from aJsonObject
.List<AttackStepBuilder>
getAttackSteps()
Returns a list of all attack steps in thisAssetBuilder
object.String
getCategory()
Returns the category of thisAssetBuilder
object.MetaBuilder
getMeta()
Returns the meta info of thisAssetBuilder
object.String
getName()
Returns the name of thisAssetBuilder
object.byte[]
getPngIcon()
Returns the PNG icon of thisAssetBuilder
object, ornull
if no PNG icon has been set.String
getSuperAsset()
Returns the super asset of thisAssetBuilder
object, ornull
if no super asset has been set.byte[]
getSvgIcon()
Returns the SVG icon of thisAssetBuilder
object, ornull
if no SVG icon has been set.List<VariableBuilder>
getVariables()
Returns a list of all variables in thisAssetBuilder
object.boolean
isAbstract()
Returns whether thisAssetBuilder
object is abstract.AssetBuilder
setPngIcon(byte[] pngIcon)
Sets the PNG icon of thisAssetBuilder
object.AssetBuilder
setSvgIcon(byte[] svgIcon)
Sets the SVG icon of thisAssetBuilder
object.
-
-
-
Constructor Detail
-
AssetBuilder
public AssetBuilder(String name, String category, boolean isAbstract, String superAsset)
Constructs a newAssetBuilder
object.- 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
- ifname
orcategory
isnull
IllegalArgumentException
- ifname
orcategory
is not a valid identifier- Since:
- 1.0.0
-
-
Method Detail
-
getName
public String getName()
Returns the name of thisAssetBuilder
object.- Returns:
- the name of this
AssetBuilder
object - Since:
- 1.0.0
-
getMeta
public MetaBuilder getMeta()
Returns the meta info of thisAssetBuilder
object.- Returns:
- the meta info of this
AssetBuilder
object - Since:
- 1.0.0
-
getCategory
public String getCategory()
Returns the category of thisAssetBuilder
object.- Returns:
- the category of this
AssetBuilder
object - Since:
- 1.0.0
-
isAbstract
public boolean isAbstract()
Returns whether thisAssetBuilder
object is abstract.- Returns:
- whether this
AssetBuilder
object is abstract - Since:
- 1.0.0
-
getSuperAsset
public String getSuperAsset()
Returns the super asset of thisAssetBuilder
object, ornull
if no super asset has been set.- Returns:
- the super asset of this
AssetBuilder
object, ornull
if no super asset has been set - Since:
- 1.0.0
-
getVariables
public List<VariableBuilder> getVariables()
Returns a list of all variables in thisAssetBuilder
object.- Returns:
- a list of all variables in this
AssetBuilder
object - Since:
- 1.0.0
-
addVariable
public AssetBuilder addVariable(VariableBuilder variable)
Adds a variable to thisAssetBuilder
object.- Parameters:
variable
- the variable to add- Returns:
- this
AssetBuilder
object - Throws:
NullPointerException
- ifvariable
isnull
- Since:
- 1.0.0
-
getAttackSteps
public List<AttackStepBuilder> getAttackSteps()
Returns a list of all attack steps in thisAssetBuilder
object.- Returns:
- a list of all attack steps in this
AssetBuilder
object - Since:
- 1.0.0
-
addAttackStep
public AssetBuilder addAttackStep(AttackStepBuilder attackStep)
Adds an attack step to thisAssetBuilder
object.- Parameters:
attackStep
- the attack step to add- Returns:
- this
AssetBuilder
object - Throws:
NullPointerException
- ifattackStep
isnull
- Since:
- 1.0.0
-
getSvgIcon
public byte[] getSvgIcon()
Returns the SVG icon of thisAssetBuilder
object, ornull
if no SVG icon has been set.- Returns:
- the SVG icon of this
AssetBuilder
object, ornull
if no SVG icon has been set - Since:
- 1.0.0
-
setSvgIcon
public AssetBuilder setSvgIcon(byte[] svgIcon)
Sets the SVG icon of thisAssetBuilder
object.- Parameters:
svgIcon
- the SVG icon to set- Returns:
- this
AssetBuilder
object - Throws:
NullPointerException
- ifsvgIcon
isnull
- Since:
- 1.0.0
-
getPngIcon
public byte[] getPngIcon()
Returns the PNG icon of thisAssetBuilder
object, ornull
if no PNG icon has been set.- Returns:
- the PNG icon of this
AssetBuilder
object, ornull
if no PNG icon has been set - Since:
- 1.0.0
-
setPngIcon
public AssetBuilder setPngIcon(byte[] pngIcon)
Sets the PNG icon of thisAssetBuilder
object.- Parameters:
pngIcon
- the PNG icon to set- Returns:
- this
AssetBuilder
object - Throws:
NullPointerException
- ifpngIcon
isnull
- Since:
- 1.0.0
-
fromJson
public static AssetBuilder fromJson(JsonObject jsonAsset, Map<String,byte[]> svgIcons, Map<String,byte[]> pngIcons)
Creates a newAssetBuilder
from aJsonObject
.- Parameters:
jsonAsset
- theJsonObject
svgIcons
- the SVG icons of the languagepngIcons
- the PNG icons of the language- Returns:
- a new
AssetBuilder
from aJsonObject
- Throws:
NullPointerException
- ifjsonAsset
,svgIcons
, orpngIcons
isnull
- Since:
- 1.0.0
-
-