예제 #1
0
 public override IEnumerator <Point> GetEnumerator()
 {
     for (var gridIndex = MinIndex; gridIndex <= MaxIndex; gridIndex++)
     {
         yield return(TileMap1D.GetTile(gridIndex, GridWidth));
     }
 }
예제 #2
0
        public override Point this[int index]
        {
            get
            {
                if (index < 0 || index >= Count)
                {
                    throw new ArgumentOutOfRangeException(nameof(index));
                }

                return(TileMap1D.GetTile(index, GridWidth));
            }
        }
예제 #3
0
        public override Point this[int index]
        {
            get
            {
                if (index < 0 || index >= Count)
                {
                    throw new ArgumentOutOfRangeException(nameof(index));
                }

                var point = TileMap1D.GetTile(index, Size.Width);
                return(Point.Add(Origin, (Size)point));
            }
        }