SequenceObjectData.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // SequenceObjectData.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.Content;
  14. #endregion
  15. namespace SceneDataLibrary
  16. {
  17. /// <summary>
  18. /// Sequence object data is stored in a sequence group and refers
  19. /// to a pattern group. A sequence group displays pattern groups
  20. /// referred to by sequence objects in sequence.
  21. /// In this case, if interpolation is needed, necessary calculations
  22. /// are performed in advance. Otherwise, pictures will be only
  23. /// sequentially switched like a simple animation.
  24. /// In Layout, sequence objects correspond to this sequence object data.
  25. ///
  26. /// シーケンスグループ内に保持され、パターングループを参照します。
  27. /// シーケンスグループは順次シーケンスオブジェクトが参照している
  28. /// パターングループを表示していきます。
  29. /// その際、補間が必要であればあらかじめ計算が行われます。
  30. /// 補完しない場合は、パタパタアニメのように
  31. /// 絵が順次切り替わるだけです。
  32. /// Layoutではシーケンスオブジェクトが相当します。
  33. /// </summary>
  34. public class SequenceObjectData
  35. {
  36. #region Fields
  37. ///Frame to be displayed
  38. ///表示するフレーム
  39. private int frame = 0;
  40. //Pattern group name to be displayed
  41. //表示するパターングループの名前
  42. private String patternGroupName = null;
  43. //Pattern group to be displayed
  44. //表示するパターングループ
  45. private PatternGroupData patternGroup = null;
  46. #endregion
  47. #region Properties
  48. /// <summary>
  49. /// Obtains and sets the frame to be displayed.
  50. ///
  51. /// 表示するフレームを設定取得します。
  52. /// </summary>
  53. public int Frame
  54. {
  55. get
  56. {
  57. return frame;
  58. }
  59. set
  60. {
  61. frame = value;
  62. }
  63. }
  64. /// <summary>
  65. /// Obtains and sets the name of the pattern group to be displayed.
  66. ///
  67. /// 表示するパターングループ名を設定取得します。
  68. /// </summary>
  69. public String PatternGroupName
  70. {
  71. get
  72. {
  73. return patternGroupName;
  74. }
  75. set
  76. {
  77. patternGroupName = value;
  78. }
  79. }
  80. /// <summary>
  81. /// Obtains the pattern object list in the pattern group to be displayed.
  82. ///
  83. /// 表示するパターングループ内のパターンオブジェクトリストを取得します。
  84. /// </summary>
  85. [ContentSerializerIgnore()]
  86. public List<PatternObjectData> PatternObjectList
  87. {
  88. get
  89. {
  90. return patternGroup.PatternObjectList;
  91. }
  92. }
  93. #endregion
  94. /// <summary>
  95. /// Performs initialization.
  96. /// Obtains the pattern group by using the specified name.
  97. ///
  98. /// 初期化します。
  99. /// 設定されている名前から、パターングループを取得します。
  100. /// </summary>
  101. /// <param name="list">
  102. /// Collection of pattern groups
  103. ///
  104. /// パターングループのコレクション
  105. /// </param>
  106. public void Init(Dictionary<String, PatternGroupData> list)
  107. {
  108. if (list.ContainsKey(PatternGroupName))
  109. patternGroup = list[PatternGroupName];
  110. }
  111. }
  112. }