Class BaseEntityConfig
java.lang.Object
com.csse3200.game.entities.configs.BaseEntityConfig
- Direct Known Subclasses:
BaseEnemyEntityConfig
,BaseFriendlyEntityConfig
Defines a basic set of properties stored in entities config files to be loaded by Entity Factories.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BaseEntityConfig
(boolean isEnemy, String spritePath, String[] soundPath) -
Method Summary
Modifier and TypeMethodDescriptionfloat
Returns the animation speed for this entity.String[]
Returns the paths to the sound files associated with this entity.Returns the path to the sprite image for this entity.boolean
Checks if the entity is friendly.void
setFriendly
(boolean friendly) Sets the entity's friendly status.
-
Field Details
-
health
protected int health -
hunger
protected int hunger -
defense
protected int defense -
speed
protected int speed -
experience
protected int experience -
isPlayer
protected boolean isPlayer -
isEnemy
protected boolean isEnemy -
spritePath
-
animationSpeed
protected float animationSpeed -
soundPath
-
-
Constructor Details
-
BaseEntityConfig
protected BaseEntityConfig() -
BaseEntityConfig
-
-
Method Details
-
getSpritePath
Returns the path to the sprite image for this entity.- Returns:
- the sprite path as a String.
-
isFriendly
public boolean isFriendly()Checks if the entity is friendly.- Returns:
- true if the entity is friendly (isEnemy == 0), false otherwise.
-
setFriendly
public void setFriendly(boolean friendly) Sets the entity's friendly status.- Parameters:
friendly
- true if the entity should be friendly (sets isEnemy to 0), false if the entity should be an enemy (sets isEnemy to 1).
-
getAnimationSpeed
public float getAnimationSpeed()Returns the animation speed for this entity.- Returns:
- the animation speed as a float.
-
getSoundPath
Returns the paths to the sound files associated with this entity.- Returns:
- an array of String representing the sound paths.
-