00001 using System;
00002
00003 using Microsoft.Xna.Framework;
00004 using Microsoft.Xna.Framework.Content;
00005 using Microsoft.Xna.Framework.Graphics;
00006
00007 using NewGamePhysics.StateManager;
00008 using NewGamePhysics.Utilities;
00009
00010 namespace NewGamePhysics.GraphicalElements
00011 {
00016 public class GraphicalElementBase
00017 {
00021 private ScreenManager screenManager;
00022
00026 private PrimitiveBatch primitiveBatch;
00027
00031 private SpriteBatch spriteBatch;
00032
00036 private Viewport viewport;
00037
00043 public GraphicalElementBase(ScreenManager manager)
00044 {
00045 if (null == manager)
00046 {
00047 throw new ArgumentNullException(
00048 "manager",
00049 "Screen manager object cannot be null");
00050 }
00051
00052
00053 this.screenManager = manager;
00054 this.primitiveBatch = this.screenManager.PrimitiveBatch;
00055 this.spriteBatch = this.screenManager.SpriteBatch;
00056 this.viewport = this.screenManager.GraphicsDevice.Viewport;
00057 }
00058
00062 public ScreenManager ScreenManager
00063 {
00064 get { return this.screenManager; }
00065 }
00066
00070 public SpriteBatch SpriteBatch
00071 {
00072 get { return this.spriteBatch; }
00073 }
00074
00078 public PrimitiveBatch PrimitiveBatch
00079 {
00080 get { return this.primitiveBatch; }
00081 }
00082
00086 public Viewport Viewport
00087 {
00088 get { return this.viewport; }
00089 }
00090 }
00091 }