public LogicProximitySensor(Segment segment, Int64 x, Int64 y, Int64 z, UInt16 cubeType, Byte flags, UInt16 value, IPlayerSource playerSource)
            : base(segment, x, y, z, cubeType, flags, value)
        {
            if (playerSource == null)
            {
                throw new ArgumentNullException(nameof(playerSource));
            }

            _playerSource = playerSource;
        }
Ejemplo n.º 2
0
        public void Update(IPlayerSource bot)
        {
            if (IsEnabled && Region.Contains(bot.MousePos))
            {
                if (bot.IsButtonPressed(MouseButton.Left))
                {
                    Click?.Invoke(null);
                }
                else if (bot.IsButtonReleased(MouseButton.Left))
                {
                    MouseUp?.Invoke(null);
                }

                if (bot.IsButtonDown(MouseButton.Left))
                {
                    MouseDown?.Invoke(null);
                }
            }
        }