Пример #1
0
 private void ReadMap(Map mapConfig)
 {
     this._map = new RoadsMap
     {
         Name        = mapConfig.Name,
         MapElements = mapConfig.Elements.Select(e => new MapElement(e)).ToList()
     };
 }
Пример #2
0
        public List <MapElement> GetVisibleElements(RoadsMap map)
        {
            List <MapElement> elements = new List <MapElement>();

            foreach (var camera in Cameras)
            {
                var visibleElements = camera.GetVisibleObjects(map);
                elements.AddRange(visibleElements);
            }

            return(elements);
        }
Пример #3
0
        public List <MapElement> GetVisibleObjects(RoadsMap map)
        {
            var elements = map.MapElements.ToList();

            switch (CameraType)
            {
            case CameraType.Front:
                return(this.GetFrontObjects(elements));

            case CameraType.Back:
                return(this.GetBackObjects(elements));

            case CameraType.Left:
                return(this.GetLeftObjects(elements));

            case CameraType.Right:
                return(this.GetRightObjects(elements));

            default:
                throw new ArgumentOutOfRangeException();
            }
        }