private void ReadMap(Map mapConfig) { this._map = new RoadsMap { Name = mapConfig.Name, MapElements = mapConfig.Elements.Select(e => new MapElement(e)).ToList() }; }
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); }
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(); } }