Class BaseEntityConfig

java.lang.Object
com.csse3200.game.entities.configs.BaseEntityConfig
Direct Known Subclasses:
BaseEnemyEntityConfig, BaseFriendlyEntityConfig

public class BaseEntityConfig extends Object
Defines a basic set of properties stored in entities config files to be loaded by Entity Factories.
  • 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

      protected String spritePath
    • animationSpeed

      protected float animationSpeed
    • soundPath

      protected String[] soundPath
  • Constructor Details

    • BaseEntityConfig

      protected BaseEntityConfig()
    • BaseEntityConfig

      public BaseEntityConfig(boolean isEnemy, String spritePath, String[] soundPath)
  • Method Details

    • getSpritePath

      public String 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

      public String[] getSoundPath()
      Returns the paths to the sound files associated with this entity.
      Returns:
      an array of String representing the sound paths.