Exemplo n.º 1
0
 private void Initialize([NotNull] Kn5RenderableCar parent)
 {
     if (_lines == null)
     {
         _lines = _lazy.Invoke(parent, parent._carData)?.ToArray() ?? new CarDebugLinesObject[0];
     }
 }
Exemplo n.º 2
0
            public void DrawLabels([NotNull] Kn5RenderableCar parent, ICamera camera, Vector2 screenSize)
            {
                Initialize(parent);

                var lines = _lines;

                if (lines == null)
                {
                    return;
                }

                for (var i = lines.Length - 1; i >= 0; i--)
                {
                    var line = lines[i];
                    parent.DrawText(line.Name, line.Transform * parent.Matrix, camera, screenSize, line.Color);
                }
            }
Exemplo n.º 3
0
            public void DrawMovementArrows([NotNull] Kn5RenderableCar parent, DeviceContextHolder holder, CameraBase camera)
            {
                var lines = _lines;

                if (lines == null)
                {
                    return;
                }

                _cloneParent = parent;
                for (var i = lines.Length - 1; i >= 0; i--)
                {
                    var line = lines[i];
                    line.CloneFunc            = ItemCloneFunc;
                    line.Movable.ParentMatrix = line.Transform * parent.Matrix;
                    line.Movable.Draw(holder, camera, SpecialRenderMode.Simple);
                }
            }
Exemplo n.º 4
0
            public void DrawLines([NotNull] Kn5RenderableCar parent, IDeviceContextHolder holder, ICamera camera)
            {
                Initialize(parent);

                var lines = _lines;

                if (lines == null)
                {
                    return;
                }

                for (var i = lines.Length - 1; i >= 0; i--)
                {
                    var line = lines[i];
                    line.Renderable.ParentMatrix = parent.RootObject.Matrix;
                    line.Renderable.Draw(holder, camera, SpecialRenderMode.Simple);
                }
            }
Exemplo n.º 5
0
            public void DrawLabels([NotNull] Kn5RenderableCar parent, ICamera camera, Vector2 screenSize)
            {
                Initialize(parent);

                var lines = _lines;

                if (lines == null)
                {
                    return;
                }

                for (var i = lines.Length - 1; i >= 0; i--)
                {
                    var line = lines[i];
                    if (string.IsNullOrWhiteSpace(line.Name))
                    {
                        return;
                    }

                    parent.DrawText(line.Name, line.Renderable.ParentMatrix * line.Transform, camera, screenSize, line.Color);
                }
            }
Exemplo n.º 6
0
 public int Count([NotNull] Kn5RenderableCar parent)
 {
     Initialize(parent);
     return(_lines?.Length ?? 0);
 }