Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 835 | chris | 1 | package com.gebauz.bauzoid.game; |
| 2 | |||
| 3 | import com.badlogic.gdx.assets.AssetManager; |
||
| 4 | import com.gebauz.bauzoid.audio.Audio; |
||
| 5 | import com.gebauz.bauzoid.gamestates.GameStateManager; |
||
| 6 | import com.gebauz.bauzoid.graphics.FontCollection; |
||
| 7 | import com.gebauz.bauzoid.graphics.Graphics; |
||
| 8 | import com.gebauz.bauzoid.graphics.renderstates.RenderStates; |
||
| 9 | import com.gebauz.bauzoid.input.Input; |
||
| 10 | |||
| 11 | |||
| 12 | /** Base class for all objects that are tied into the game graph. */ |
||
| 13 | public abstract class GameObject |
||
| 14 | { |
||
| 15 | private Game mGame = null; |
||
| 16 | |||
| 17 | /** Constructor. */ |
||
| 18 | public GameObject(Game game) |
||
| 19 | { |
||
| 20 | mGame = game; |
||
| 21 | } |
||
| 22 | |||
| 23 | /** Get the root game object. */ |
||
| 24 | public final Game getGame() |
||
| 25 | { |
||
| 26 | return mGame; |
||
| 27 | } |
||
| 28 | |||
| 29 | /** Convenience getter. */ |
||
| 30 | public final Graphics getGraphics() |
||
| 31 | { |
||
| 32 | return getGame().getGraphics(); |
||
| 33 | } |
||
| 34 | |||
| 35 | /** Convenience getter. */ |
||
| 36 | public final Audio getAudio() |
||
| 37 | { |
||
| 38 | return getGame().getAudio(); |
||
| 39 | } |
||
| 40 | |||
| 41 | /** Convenience getter. */ |
||
| 42 | public final Input getInput() |
||
| 43 | { |
||
| 44 | return getGame().getInput(); |
||
| 45 | } |
||
| 46 | |||
| 47 | /** Convenience getter. */ |
||
| 48 | public final FontCollection getFonts() |
||
| 49 | { |
||
| 50 | return getGame().getFonts(); |
||
| 51 | } |
||
| 52 | |||
| 53 | /** Convenience getter. */ |
||
| 54 | public final AssetManager getAssetManager() |
||
| 55 | { |
||
| 56 | return getGame().getAssetManager(); |
||
| 57 | } |
||
| 58 | |||
| 59 | /** Convenience getter. */ |
||
| 60 | public final RenderStates getRenderStates() |
||
| 61 | { |
||
| 62 | return getGraphics().renderStates; |
||
| 63 | } |
||
| 64 | |||
| 65 | public final GameStateManager getGameStateManager() |
||
| 66 | { |
||
| 67 | return getGame().getGameStateManager(); |
||
| 68 | } |
||
| 69 | |||
| 70 | } |
||
| 71 | |||
| 72 | |||
| 73 | |||
| 74 |