Exemple #1
0
        private void EnsureElementExists(Coordinate a_coordinate)
        {
            if (a_coordinate.Length != m_dimensions)
            {
                throw new ArgumentOutOfRangeException();
            }

            if (m_elements.TryGetValue(a_coordinate, out _))
            {
                return;
            }
            var newElement = new GridElement(a_coordinate, this)
            {
                IsActive = false
            };

            m_elements.Add(a_coordinate, newElement);
        }