Advertisement
Guest User

ProjectMetaData

a guest
Nov 13th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. private KeywordFlag keyword = KeywordFlag.None;
  2.  
  3. /// <summary>
  4. /// The data of the editor camera. We save last position in editor and so on.
  5. /// </summary>
  6. private GraphicalInterface.Utility.EditorCameraData editorCameraData;
  7.  
  8. /// <summary>
  9. /// The last date that the project was edited.
  10. /// </summary>
  11. private GraphicalInterface.Utility.Date lastEditedDate;
  12.  
  13. //// TODO: Add information about how many bytes the Project file will be, this way we can check when reading if we are getting the correct Project and a valid one.
  14.  
  15. /// <summary>
  16. /// Constructor, initializes the ProjectMetaData with the given values.
  17. /// </summary>
  18. /// <param name="json">All text-based data to store.</param>
  19. /// <param name="byteArray">All binary-based data to store.</param>
  20. public ProjectMetaData(string json, byte[] byteArray)
  21. {
  22. this.name = defaultProjectName;
  23. this.Deserialize(JToken.Parse(json), new BinaryCollectionArray(ref byteArray));
  24. }
  25.  
  26. /// <summary>
  27. /// A normal constructor. So that we can create empty ProjectMetaData which we can pass in methods.
  28. /// </summary>
  29. public ProjectMetaData()
  30. {
  31. this.name = defaultProjectName;
  32.  
  33. // This does nothing and should never be the end result, but is used at some spots where we for example want to pass an empty ProjectMetaData inside a function.
  34. this.localThumbnail = PaperEngine.GraphicalInterface.UIManager.Instance.ProjectDefaultThumbnail;
  35. }
  36.  
  37. /// <summary>
  38. /// Enum for denoting genre.
  39. /// </summary>
  40. [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
  41. public enum Genre
  42. {
  43. [System.Runtime.Serialization.EnumMember(Value = "Platformer")]
  44. Platformer,
  45. [System.Runtime.Serialization.EnumMember(Value = "Racing")]
  46. Racing
  47. }
  48.  
  49. /// <summary>
  50. /// The project type.
  51. /// </summary>
  52. public enum ProjectType
  53. {
  54. ADVANCED, // This one is placed as first element to support old levels which didn't have this feature (default value).
  55. CLASSIC
  56. }
  57.  
  58. public enum KeywordFlag : uint
  59. {
  60. None = 0U,
  61. IntroEditorTutorial = 1U << 0,
  62. }
  63.  
  64. public KeywordFlag Keyword
  65. {
  66. get
  67. {
  68. return this.keyword;
  69. }
  70. set
  71. {
  72. this.keyword = value;
  73. }
  74. }
  75.  
  76. public bool ContainsKeyword(KeywordFlag keyword)
  77. {
  78. return (this.keyword & keyword) == keyword;
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement