public void MouseLeftButtonDown(Point pixelPosition)
        {
            pixelPosition.Y = PixelHeight - pixelPosition.Y;

            if (EditorMode == EditorMode.Select)
            {
                Platforms.Apply(p => p.IsSelected = false);
                PlatformWrapper platform = GetPlatformAtPosition(pixelPosition);
                if (platform != null)
                {
                    platform.IsSelected             = true;
                    mEditorManager.SelectedPlatform = platform;
                    mIsDragging = true;
                }
                else
                {
                    mEditorManager.SelectedPlatform = null;
                }
            }
            else if (EditorMode == EditorMode.Platform)
            {
                PlatformWrapper addedPlatform = new PlatformWrapper(new PlatformData(-1, 0.0, 0.0, PlatformType.Normal, null, null));
                SetObjectPosition(addedPlatform, pixelPosition);

                Platforms.Add(addedPlatform);
                UpdateModel();
            }
        }
        private void SetObjectPosition(PlatformWrapper platform, Point pixelPosition)
        {
            Point position = GetGameAreaPosition(pixelPosition);

            double x = MathUtil.LimitDouble(position.X - PlatformWrapper.PLATFORM_WIDTH / 2.0f, 0.0f, PlatformWrapper.MAX_PLATFORM_X);
            double y = Math.Max(position.Y - PlatformWrapper.PLATFORM_HEIGHT / 2.0f, 0.0f);

            x = Math.Round(x, 2);
            y = Math.Round(y, 2);

            platform.PlatformData.X = x;
            platform.PlatformData.Y = y;

            platform.Update();
        }
        public void MouseRightButtonDown(Point pixelPosition)
        {
            pixelPosition.Y = PixelHeight - pixelPosition.Y;

            PlatformWrapper platform = GetPlatformAtPosition(pixelPosition);

            if (platform != null)
            {
                Platforms.Remove(platform);
                if (mEditorManager.SelectedPlatform == platform)
                {
                    mEditorManager.SelectedPlatform = null;
                }

                UpdateModel();
            }
        }
        public void MouseMove(Point pixelPosition)
        {
            if (EditorMode != EditorMode.Select)
            {
                return;
            }

            pixelPosition.Y = PixelHeight - pixelPosition.Y;

            Platforms.Apply(p => p.IsOver = false);
            PlatformWrapper platform = GetPlatformAtPosition(pixelPosition);

            if (platform != null)
            {
                platform.IsOver = true;
            }

            if (mIsDragging)
            {
                SetObjectPosition(mEditorManager.SelectedPlatform, pixelPosition);
                UpdateModel();
            }
        }