Package de.coreengine.asset
Class AssetDatabase
- java.lang.Object
-
- de.coreengine.asset.AssetDatabase
-
public class AssetDatabase extends Object
Class to store loaded assets
-
-
Constructor Summary
Constructors Constructor Description AssetDatabase()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addAnimatedModel(String name, AnimatedModel model)
Manually store an animated model into the database.static void
addFont(String name, Font font)
Manually store a font into the database.static void
addModel(String name, Model model)
Manually store a model into the database.static void
addSound(String name, Integer sound)
Manually store a sound into the database.static void
addTexture(String name, Integer texture)
Manually store a texture into the database.static AnimatedModel
getAnimatedModel(String name)
Getting animated model by name from the database.static Font
getFont(String name)
Getting font by name from the database.static Model
getModel(String name)
Getting model by name from the database.static int
getSound(String name)
Getting sound by name from the database.static int
getTexture(String name)
Getting texture by name from the database.
-
-
-
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 texturetexture
- 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 fontfont
- 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 soundsound
- 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 modelmodel
- 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 modelmodel
- Model to store
-
-