ISavedGameMetadata.cs 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // <copyright file="ISavedGameMetadata.cs" company="Google Inc.">
  2. // Copyright (C) 2014 Google Inc.
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. // </copyright>
  16. namespace GooglePlayGames.BasicApi.SavedGame
  17. {
  18. using System;
  19. /// <summary>
  20. /// Interface representing the metadata for a saved game. These instances are also used as handles
  21. /// for reading and writing the content of the underlying file.
  22. /// </summary>
  23. public interface ISavedGameMetadata
  24. {
  25. /// <summary>
  26. /// Returns true if this metadata can be used for operations related to raw file data (i.e.
  27. /// the binary data contained in the underlying file). Metadata returned by Open operations
  28. /// will be "Open". After an update to the file is committed or the metadata is used to resolve
  29. /// a conflict, the corresponding Metadata is closed, and IsOpen will return false.
  30. ///
  31. /// </summary>
  32. /// <value><c>true</c> if this instance is open; otherwise, <c>false</c>.</value>
  33. bool IsOpen { get; }
  34. /// <summary>
  35. /// Returns the filename for this saved game. A saved game filename will only consist of
  36. /// non-URL reserved characters (i.e. a-z, A-Z, 0-9, or the symbols "-", ".", "_", or "~")
  37. /// and will between 1 and 100 characters in length (inclusive).
  38. /// </summary>
  39. /// <value>The filename.</value>
  40. string Filename { get; }
  41. /// <summary>
  42. /// Returns a human-readable description of what the saved game contains. This may be null.
  43. /// </summary>
  44. /// <value>The description.</value>
  45. string Description { get; }
  46. /// <summary>
  47. /// A URL corresponding to the PNG-encoded image corresponding to this saved game. null if
  48. /// the saved game does not have a cover image.
  49. /// </summary>
  50. /// <value>The cover image URL.</value>
  51. string CoverImageURL { get; }
  52. /// <summary>
  53. /// Returns the total time played by the player for this saved game. This value is
  54. /// developer-specified and may be tracked in any way that is appropriate to the game. Note
  55. /// that this value is specific to this specific saved game (unless the developer intentionally
  56. /// sets the same value on all saved games). If the value was not set, this will be equal to
  57. /// <code>TimeSpan.FromMilliseconds(0)</code>
  58. /// </summary>
  59. /// <value>The total time played.</value>
  60. TimeSpan TotalTimePlayed { get; }
  61. /// <summary>
  62. /// A timestamp corresponding to the last modification to the underlying saved game. If the
  63. /// saved game is newly created, this value will correspond to the time the first Open
  64. /// occurred. Otherwise, this corresponds to time the last successful write occurred (either by
  65. /// CommitUpdate or Resolve methods).
  66. /// </summary>
  67. /// <value>The last modified timestamp.</value>
  68. DateTime LastModifiedTimestamp { get; }
  69. }
  70. }