StageSetting.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // StageSetting.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 Microsoft.Xna.Framework;
  12. using Microsoft.Xna.Framework.Content;
  13. #endregion
  14. namespace MovipaLibrary
  15. {
  16. /// <summary>
  17. /// This class manages setting information of stages.
  18. /// ContentTypeReader and ContentTypeWriter are provided in this class
  19. /// so that stage construction information can be specified by ContentPipeline.
  20. ///
  21. /// ステージの設定情報を管理します。
  22. /// このクラスは、ステージ構成をContentPipelineを通して設定出来るように
  23. /// ContentTypeReaderとContentTypeWriterを用意しています。
  24. /// </summary>
  25. public class StageSetting
  26. {
  27. #region Public Types
  28. /// <summary>
  29. /// Game mode
  30. ///
  31. /// ゲームモード
  32. /// </summary>
  33. public enum ModeList
  34. {
  35. Normal,
  36. Free,
  37. }
  38. /// <summary>
  39. /// Panel switch mode
  40. ///
  41. /// パネルの入れ替えるモード
  42. /// </summary>
  43. public enum StyleList
  44. {
  45. Change,
  46. Revolve,
  47. Slide,
  48. }
  49. /// <summary>
  50. /// Rotation
  51. ///
  52. /// 回転
  53. /// </summary>
  54. public enum RotateMode
  55. {
  56. On,
  57. Off,
  58. }
  59. #endregion
  60. #region Fields
  61. private ModeList mode;
  62. private StyleList style;
  63. private RotateMode rotate;
  64. private string movie;
  65. private Point divide;
  66. private TimeSpan timeLimit;
  67. #endregion
  68. #region Properties
  69. /// <summary>
  70. /// Obtains or sets the game mode.
  71. ///
  72. /// ゲームモードを取得または設定します。
  73. /// </summary>
  74. public ModeList Mode
  75. {
  76. get { return mode; }
  77. set { mode = value; }
  78. }
  79. /// <summary>
  80. /// Obtains or sets the game style.
  81. ///
  82. /// ゲームスタイルを取得または設定します。
  83. /// </summary>
  84. public StyleList Style
  85. {
  86. get { return style; }
  87. set { style = value; }
  88. }
  89. /// <summary>
  90. /// Obtains or sets the rotation information (rotation is enabled or not).
  91. ///
  92. /// 回転の有無を取得または設定します。
  93. /// </summary>
  94. public RotateMode Rotate
  95. {
  96. get { return rotate; }
  97. set { rotate = value; }
  98. }
  99. /// <summary>
  100. /// Obtains or sets the asset name for the movie information.
  101. ///
  102. /// ムービー情報へのアセット名を取得または設定します。
  103. /// </summary>
  104. public string Movie
  105. {
  106. get { return movie; }
  107. set { movie = value; }
  108. }
  109. /// <summary>
  110. /// Obtains or sets the number of divisions.
  111. ///
  112. /// 分割数を取得または設定します。
  113. /// </summary>
  114. public Point Divide
  115. {
  116. get { return divide; }
  117. set { divide = value; }
  118. }
  119. /// <summary>
  120. /// Obtains or sets the time limit of the stage.
  121. ///
  122. /// ステージの制限時間を取得または設定します。
  123. /// </summary>
  124. [ContentSerializerIgnore]
  125. public TimeSpan TimeLimit
  126. {
  127. get { return timeLimit; }
  128. }
  129. /// <summary>
  130. /// Obtains or sets the time limit of the stage as a character string.
  131. ///
  132. /// ステージの制限時間を文字列型で取得または設定します。
  133. /// </summary>
  134. public string TimeLimitString
  135. {
  136. get
  137. {
  138. return timeLimit.ToString();
  139. }
  140. set
  141. {
  142. TimeSpan result = new TimeSpan();
  143. try
  144. {
  145. result = TimeSpan.Parse(value);
  146. }
  147. finally
  148. {
  149. timeLimit = result;
  150. }
  151. }
  152. }
  153. #endregion
  154. #region Initialization
  155. /// <summary>
  156. /// Initializes the instance.
  157. ///
  158. /// インスタンスを初期化します。
  159. /// </summary>
  160. public StageSetting()
  161. {
  162. mode = ModeList.Normal;
  163. style = StyleList.Change;
  164. rotate = RotateMode.Off;
  165. movie = String.Empty;
  166. divide = new Point(3, 3);
  167. timeLimit = new TimeSpan();
  168. }
  169. #endregion
  170. }
  171. }