Beispiel #1
0
        public void HandleMouse_ActiveOutsideTargetArea_DoesNotChangeTarget()
        {
            var mouse = new MouseData()
            {
                MouseActive = true
            };

            _renderer
            .GetGameplayMapCoordinateFromMousePosition(Arg.Any <MapCoordinate>(), Arg.Any <int>(), Arg.Any <int>())
            .Returns(new MapCoordinate("Map", 1000, 1000));

            _targetingActivity.HandleMouse(_systemContainer, mouse);

            _targetingActivity.CurrentTarget.Should().BeNull();
            _callbackHappened.Should().BeFalse();
        }
Beispiel #2
0
        public void HandleMouseInput(MouseData mouse)
        {
            var x = mouse.X;
            var y = mouse.Y;

            if (_activitySystem.Peek() is GameplayActivity activity && _systemContainer.PlayerSystem.Player != null)
            {
                IUnifiedRenderer renderer = _systemContainer.RendererSystem.Renderer;
                var hoveredLocation       = renderer.GetGameplayMapCoordinateFromMousePosition(_systemContainer.RendererSystem.CameraPosition, x, y);

                SetHoveredLocation(hoveredLocation);
            }
        }