GameWorld.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // GameWorld.cs
  4. //
  5. // Microsoft XNA Community Game Platform
  6. // Copyright (C) Microsoft Corporation. All rights reserved.
  7. //-----------------------------------------------------------------------------
  8. #endregion
  9. #region Using Statements
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Text;
  13. using Microsoft.Xna.Framework;
  14. using Microsoft.Xna.Framework.Content;
  15. using Microsoft.Xna.Framework.Graphics;
  16. using RobotGameData.Render;
  17. using RobotGameData.Resource;
  18. #endregion
  19. namespace RobotGameData.GameObject
  20. {
  21. /// <summary>
  22. /// this model class processes the 3D world model.
  23. /// It contains cube map texture.
  24. /// </summary>
  25. public class GameWorld : GameModel
  26. {
  27. #region Fields
  28. // Cube map texture.
  29. public TextureCube textureCubeMap = null;
  30. #endregion
  31. #region Properties
  32. public TextureCube TextureCubeMap
  33. {
  34. get { return textureCubeMap; }
  35. set { textureCubeMap = value; }
  36. }
  37. #endregion
  38. /// <summary>
  39. /// Constructor.
  40. /// </summary>
  41. /// <param name="resource">model resource</param>
  42. public GameWorld(GameResourceModel resource)
  43. : base(resource) {}
  44. /// <summary>
  45. /// Constructor.
  46. /// </summary>
  47. /// <param name="fileName">model file name</param>
  48. public GameWorld(string fileName)
  49. : base(fileName) {}
  50. public override void Initialize()
  51. {
  52. base.Initialize();
  53. }
  54. protected override void OnUpdate(GameTime gameTime)
  55. {
  56. base.OnUpdate(gameTime);
  57. }
  58. protected override void OnDraw(RenderTracer renderTracer)
  59. {
  60. base.OnDraw(renderTracer);
  61. }
  62. /// <summary>
  63. /// load cube map texture.
  64. /// </summary>
  65. /// <param name="file">cube map texture file name</param>
  66. public void LoadTextureCubeMap(string file)
  67. {
  68. this.TextureCubeMap = FrameworkCore.ContentManager.Load<TextureCube>(
  69. file);
  70. }
  71. protected override void Dispose(bool disposing)
  72. {
  73. if (textureCubeMap != null)
  74. {
  75. textureCubeMap.Dispose();
  76. textureCubeMap = null;
  77. }
  78. base.Dispose(disposing);
  79. }
  80. protected override void UnloadContent()
  81. {
  82. base.UnloadContent();
  83. }
  84. }
  85. }