summaryrefslogtreecommitdiff
path: root/Plugins/MonoGame.Extended/source/MonoGame.Extended.Tiled/TiledMapTilesetTile.cs
blob: e378aa3f1dfe9ea38c2e2fdbd8b544bc1be55c9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System.Collections.Generic;
using System.Diagnostics;
using Microsoft.Xna.Framework.Graphics;

namespace MonoGame.Extended.Tiled
{
    [DebuggerDisplay("{LocalTileIdentifier}: Type: {Type}, Properties: {Properties.Count}, Objects: {Objects.Count}")]
    public class TiledMapTilesetTile
    {
        // For remove libraries
        public TiledMapTilesetTile(int localTileIdentifier, string type = null,
            TiledMapObject[] objects = null)
        {
            LocalTileIdentifier = localTileIdentifier;
            Type = type;
            Objects = objects != null ? new List<TiledMapObject>(objects) : new List<TiledMapObject>();
            Properties = new TiledMapProperties();
        }

        public TiledMapTilesetTile(int localTileIdentifier, string type = null,
            TiledMapObject[] objects = null, Texture2D texture = null)
        {
            Texture = texture;
            LocalTileIdentifier = localTileIdentifier;
            Type = type;
            Objects = objects != null ? new List<TiledMapObject>(objects) : new List<TiledMapObject>();
            Properties = new TiledMapProperties();
        }

        public int LocalTileIdentifier { get; }
        public string Type { get; }
        public TiledMapProperties Properties { get; }
        public List<TiledMapObject> Objects { get; }
        public Texture2D Texture { get; }
    }
}