using System.Collections.Generic;

namespace MonoGame.FourEngine
{
    public struct Range
    {
        public readonly int Start;
        public readonly int Count;

        public int End => Start + Count - 1;
        public int Avg => (Start + End) / 2;

        public Range(int start, int count)
        {
            Start = start;
            Count = count;
        }

        public bool Contains(int value)
            => value >= Start && value <= End;

        public IEnumerable<int> Enumerable => System.Linq.Enumerable.Range(Start, Count);
    }
}