using System.Collections.Generic;


namespace ActionGame.GameArtifacts.Models.Characters
{
    public class MoveableObjectComparer : IComparer<IMoveableObject>
    {
        public int Compare(IMoveableObject m1, IMoveableObject m2)
        {
            if(m1.WorldPosition.PositionY > m2.WorldPosition.PositionY)
            {
                return 1;
            }
            else if (m1.WorldPosition.PositionY < m2.WorldPosition.PositionY)
            {
                return -1;
            }
            else
            {
                if(m1.WorldPosition.PositionX < m2.WorldPosition.PositionY)
                {
                    return 1;
                }
                else
                {
                    return 0;
                }
            }
        }
    }
}
