Exemplo n.º 1
0
        protected override Area this[int x, int y]
        {
            get
            {
                var area = Areas[x, y];
                if (area != null)
                {
                    return(area);
                }

                var areaString = _areaStrings[x + y * _size];
                return(Areas[x, y] = new LazyArea(areaString, x, y));
            }
        }
Exemplo n.º 2
0
 public LazyAreaArray(string[] areaStrings)
 {
     _areaStrings = areaStrings;
     _size        = (int)Math.Sqrt(areaStrings.Length);
     Areas        = new LazyArea[_size, _size];
 }