private void DrawCurrentTrack(Point point) { _currentTrackPoint?.Clear(); _currentTrackPoint = new PointData(CanvasRef) { Point = point, PointVisual = DrawPointObject(point, Brushes.Yellow, DotType.CurrentTrack) }; }
private void DrawRandom(Point point) { _randomPoint?.Clear(); _randomPoint = new PointData(CanvasRef) { Point = point, PointVisual = DrawPointObject(point, Brushes.LawnGreen, DotType.Random) }; OnPointAdded?.Invoke(this, new PointArgs(point, DotType.Random)); }
/// <summary> /// Clear game field. /// </summary> public void Clear() { foreach (var point in _anchorPoints) { point.Clear(); } _currentTrackPoint.Clear(); _randomPoint.Clear(); foreach (var point in _trackPoints) { point.Clear(); } _trackPoints.Clear(); _anchorPoints.Clear(); _currentTrackPoint = _randomPoint = null; }