Class AssetDatabase


  • public class AssetDatabase
    extends Object
    Class to store loaded assets
    • Constructor Detail

      • AssetDatabase

        public AssetDatabase()
    • Method Detail

      • getTexture

        public static int getTexture​(String name)
        Getting texture by name from the database. Returns 0, if the texture could not be found
        Parameters:
        name - Name of the texture in the database
        Returns:
        Texture with this name
      • addTexture

        public static void addTexture​(String name,
                                      Integer texture)
        Manually store a texture into the database. If a texture with this name already exist, it will be overwritten!
        Parameters:
        name - Name of the texture
        texture - Texture to store
      • getFont

        public static Font getFont​(String name)
        Getting font by name from the database. Returns null, if the font could not be found
        Parameters:
        name - Name of the font in the database
        Returns:
        Font with this name
      • addFont

        public static void addFont​(String name,
                                   Font font)
        Manually store a font into the database. If a font with this name already exist, it will be overwritten!
        Parameters:
        name - Name of the font
        font - Font to store
      • getSound

        public static int getSound​(String name)
        Getting sound by name from the database. Returns 0, if the sound could not be found
        Parameters:
        name - Name of the sound in the database
        Returns:
        Sound with this name
      • addSound

        public static void addSound​(String name,
                                    Integer sound)
        Manually store a sound into the database. If a sound with this name already exist, it will be overwritten!
        Parameters:
        name - Name of the sound
        sound - Sound to store
      • getModel

        public static Model getModel​(String name)
        Getting model by name from the database. Returns null, if the model could not be found
        Parameters:
        name - Name of the model in the database
        Returns:
        Model with this name
      • addModel

        public static void addModel​(String name,
                                    Model model)
        Manually store a model into the database. If a model with this name already exist, it will be overwritten!
        Parameters:
        name - Name of the model
        model - Model to store
      • getAnimatedModel

        public static AnimatedModel getAnimatedModel​(String name)
        Getting animated model by name from the database. Returns null, if the animated model could not be found
        Parameters:
        name - Name of the animated model in the database
        Returns:
        Animated model with this name
      • addAnimatedModel

        public static void addAnimatedModel​(String name,
                                            AnimatedModel model)
        Manually store an animated model into the database. If an animated model with this name already exist, it will be overwritten!
        Parameters:
        name - Name of the model
        model - Model to store