TiledMapPropertyValue.cs 843 B

1234567891011121314151617181920212223242526272829303132
  1. namespace MonoGame.Extended.Tiled;
  2. public class TiledMapPropertyValue
  3. {
  4. public string Value { get; }
  5. public TiledMapProperties Properties;
  6. public TiledMapPropertyValue()
  7. {
  8. Value = string.Empty;
  9. Properties = new();
  10. }
  11. public TiledMapPropertyValue(string value)
  12. {
  13. Value = value;
  14. Properties = new();
  15. }
  16. public TiledMapPropertyValue(TiledMapProperties properties)
  17. {
  18. Value = string.Empty;
  19. Properties = properties;
  20. }
  21. public override string ToString() => Value;
  22. //public static implicit operator TiledMapPropertyValue(string value) => new(value);
  23. public static implicit operator string(TiledMapPropertyValue value) => value.Value;
  24. public static implicit operator TiledMapProperties(TiledMapPropertyValue value) => value.Properties;
  25. }