TiledMapObject.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using Microsoft.Xna.Framework;
  2. namespace MonoGame.Extended.Tiled
  3. {
  4. public abstract class TiledMapObject
  5. {
  6. protected TiledMapObject(int identifier, string name, SizeF size, Vector2 position, float rotation = 0, float opacity = 1, bool isVisible = true, string type = null)
  7. {
  8. Identifier = identifier;
  9. Name = name;
  10. IsVisible = isVisible;
  11. Rotation = rotation;
  12. Position = position;
  13. Size = size;
  14. Opacity = opacity;
  15. Type = type;
  16. Properties = new TiledMapProperties();
  17. }
  18. public int Identifier { get; }
  19. public string Name { get; set; }
  20. public string Type { get; set; }
  21. public bool IsVisible { get; set; }
  22. public float Opacity { get; set; }
  23. public float Rotation { get; set; }
  24. public Vector2 Position { get; }
  25. public SizeF Size { get; set; }
  26. public TiledMapProperties Properties { get; }
  27. public override string ToString()
  28. {
  29. return $"{Identifier}";
  30. }
  31. }
  32. }