예제 #1
0
        /// <summary>
        /// Removes a MapGrh from the map
        /// </summary>
        /// <param name="mg">MapGrh to remove from the map</param>
        public void RemoveMapGrh(MapGrh mg)
        {
            if (mg == null)
            {
                Debug.Fail("mg is null.");
                return;
            }

            Debug.Assert(Spatial.CollectionContains(mg), string.Format("MapGrh `{0}` isn't in the spatial collection.", mg));

            // Remove from the spatial
            Spatial.Remove(mg);
        }
예제 #2
0
        /// <summary>
        /// Adds a MapGrh to the map
        /// </summary>
        /// <param name="mg">MapGrh to add to the map</param>
        public void AddMapGrh(MapGrh mg)
        {
            if (mg == null)
            {
                const string errmsg = "Parameter mg is null.";
                if (log.IsErrorEnabled)
                {
                    log.Error(errmsg);
                }
                Debug.Fail(errmsg);
                return;
            }

            // When in debug mode, ensure there are no duplicates
            Debug.Assert(!Spatial.CollectionContains(mg), string.Format("MapGrh `{0}` is already in the spatial collection.", mg));

            // Add to the spatial
            Spatial.Add(mg);
        }