Class ItemTexturePathGetter

java.lang.Object
com.csse3200.game.components.items.ItemTexturePathGetter

public class ItemTexturePathGetter extends Object
ItemTexturePathGetter is a static class whose only purpose is to return the correct texture path of an item based on its type and depending on its state will return the correct picture. Note that this class could potentially return a string refers to an image path that might not exist, or the image might not be loaded. In these instances if a call is made to get the asset, a GdxRuntimeException will be thrown resulting in a game crash. So please keep this in mind
  • Constructor Details

    • ItemTexturePathGetter

      public ItemTexturePathGetter()
  • Method Details

    • getTexturePath

      public static String getTexturePath(Entity entity)
      Static function to return the texture path based on the entity and potentially the state of the entity.
      Parameters:
      entity - the food entity to get the texture for
      Returns:
      the path to the texture if entity is an item, null otherwise