TiledMapTilesetTile.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using System.Collections.Generic;
  2. using System.Diagnostics;
  3. using Microsoft.Xna.Framework.Graphics;
  4. namespace MonoGame.Extended.Tiled
  5. {
  6. [DebuggerDisplay("{LocalTileIdentifier}: Type: {Type}, Properties: {Properties.Count}, Objects: {Objects.Count}")]
  7. public class TiledMapTilesetTile
  8. {
  9. // For remove libraries
  10. public TiledMapTilesetTile(int localTileIdentifier, string type = null,
  11. TiledMapObject[] objects = null)
  12. {
  13. LocalTileIdentifier = localTileIdentifier;
  14. Type = type;
  15. Objects = objects != null ? new List<TiledMapObject>(objects) : new List<TiledMapObject>();
  16. Properties = new TiledMapProperties();
  17. }
  18. public TiledMapTilesetTile(int localTileIdentifier, string type = null,
  19. TiledMapObject[] objects = null, Texture2D texture = null)
  20. {
  21. Texture = texture;
  22. LocalTileIdentifier = localTileIdentifier;
  23. Type = type;
  24. Objects = objects != null ? new List<TiledMapObject>(objects) : new List<TiledMapObject>();
  25. Properties = new TiledMapProperties();
  26. }
  27. public int LocalTileIdentifier { get; }
  28. public string Type { get; }
  29. public TiledMapProperties Properties { get; }
  30. public List<TiledMapObject> Objects { get; }
  31. public Texture2D Texture { get; }
  32. }
  33. }