State.cs 1010 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using Microsoft.Xna.Framework;
  2. using Microsoft.Xna.Framework.Content;
  3. using Microsoft.Xna.Framework.Graphics;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using Tutorial030.Models;
  10. namespace Tutorial030.States
  11. {
  12. public abstract class State
  13. {
  14. protected GameModel _gameModel;
  15. protected ContentManager _content
  16. {
  17. get
  18. {
  19. return _gameModel.ContentManger;
  20. }
  21. }
  22. protected GraphicsDeviceManager _graphics
  23. {
  24. get
  25. {
  26. return _gameModel.GraphicsDeviceManager;
  27. }
  28. }
  29. protected SpriteBatch _spriteBatch
  30. {
  31. get
  32. {
  33. return _gameModel.SpriteBatch;
  34. }
  35. }
  36. public State(GameModel gameModel)
  37. {
  38. _gameModel = gameModel;
  39. }
  40. public abstract void LoadContent();
  41. public abstract void Update(GameTime gameTime);
  42. public abstract void Draw(GameTime gameTime);
  43. }
  44. }