public T this[int x, int y, int z] { set { checkBounds(x, y, z); string key = getDictKey(x, y, z); _matrix.Add(key, value); } get { checkBounds(x, y, z); var key = getDictKey(x, y, z); if (_matrix.ContainsKey(key)) { return(_matrix[key]); } return(_сheckEmpty.getEmptyElement()); } }
/// <summary> /// Индексатор для доступа к данных /// </summary> public T this[int x, int y, int z] { get { CheckBounds(x, y, z); string key = DictKey(x, y, z); if (_matrix.ContainsKey(key)) { return(_matrix[key]); } else { return(nullElement.getEmptyElement()); } } set { CheckBounds(x, y, z); string key = DictKey(x, y, z); this._matrix.Add(key, value); } }