2
0

GameResourceAnimation.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // GameResourceAnimation.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 RobotGameData.GameObject;
  15. #endregion
  16. namespace RobotGameData.Resource
  17. {
  18. /// <summary>
  19. /// a resource element structure with AnimationSequence class.
  20. /// When an animation(.Animation) file is loaded from the resource manager,
  21. /// it gets stored here.
  22. /// </summary>
  23. public class GameResourceAnimation : GameResourceBase
  24. {
  25. #region Fields
  26. AnimationSequence animationSequence = null;
  27. #endregion
  28. #region Properties
  29. public AnimationSequence Animation
  30. {
  31. get { return animationSequence; }
  32. }
  33. #endregion
  34. /// <summary>
  35. /// Constructor.
  36. /// </summary>
  37. /// <param name="key">key name</param>
  38. /// <param name="assetName">asset name</param>
  39. /// <param name="resource">animation resource</param>
  40. public GameResourceAnimation(string key, string assetName,
  41. AnimationSequence resource)
  42. : base(key, assetName)
  43. {
  44. this.animationSequence = resource;
  45. this.resource = (object)this.animationSequence;
  46. }
  47. protected override void Dispose(bool disposing)
  48. {
  49. if (disposing)
  50. {
  51. if (animationSequence != null)
  52. {
  53. animationSequence = null;
  54. }
  55. }
  56. base.Dispose(disposing);
  57. }
  58. }
  59. }