﻿/// Tmx C# Loader for SFML
/// by Vinicius "Epiplon" Castanheira
/// 
/// This software is under the GPL 3.0
/// You should receive a copy of this license within the program
/// If not, check it at https://www.gnu.org/licenses/gpl-3.0.txt

using System;
using System.Collections.Generic;
using SFML.Graphics;

namespace SharpTMX
{
	public class TiledObject
    {
        // The name of the object. An arbitrary string.
        #region Name
        private string _name;
        public string Name
        {
            get { return _name; }
            set
            {
                if (value != null)
                {
                    _name = null;
                }
                else _name = "";
            }
        }
        #endregion 
        // The type of the object. An arbitrary string.
        #region Type
        private string _type;
        public string Type
        {
            get { return _type; }
            set
            {
                if (value != null)
                {
                    _type = value;
                }
                else _type = "";
            }
        }  
        #endregion
        // The x coordinate of the object in pixels.

        public int X { get; set; }
        public int Y { get; set; }        // The y coordinate of the object in pixels.
		public int Width { get; set; }    // The width of the object in pixels.
		public int Height { get; set; }   // The height of the object in pixels.
        public int Gid;                   // Reference to a tile. Object is the size of a tile and have no width and height.
		public Dictionary<string, object> Properties { get; set; } // Properties of each object in Tiled

		public TiledObject() {
			Properties = new Dictionary<string, object>();
			Name = Type = "";
			X = Y = Width = Height = Gid = 0;
		}
	}
}
