コード例 #1
0
ファイル: Actions.cs プロジェクト: JacquesBonet/selenium-1
        /// <summary>
        /// Initializes a new instance of the <see cref="Actions"/> class.
        /// </summary>
        /// <param name="driver">The <see cref="IWebDriver"/> object on which the actions built will be performed.</param>
        public Actions(IWebDriver driver)
        {
            IHasInputDevices inputDevicesDriver = driver as IHasInputDevices;
            if (inputDevicesDriver == null)
            {
                IWrapsDriver wrapper = driver as IWrapsDriver;
                while (wrapper != null)
                {
                    inputDevicesDriver = wrapper.WrappedDriver as IHasInputDevices;
                    if (inputDevicesDriver != null)
                    {
                        break;
                    }

                    wrapper = wrapper.WrappedDriver as IWrapsDriver;
                }
            }

            if (inputDevicesDriver == null)
            {
                throw new ArgumentException("The IWebDriver object must implement or wrap a driver that implements IHasInputDevices.", "driver");
            }

            this.keyboard = inputDevicesDriver.Keyboard;
            this.mouse = inputDevicesDriver.Mouse;
        }
コード例 #2
0
ファイル: _Library.cs プロジェクト: mrange/funbasic
 public static void Initialize(         
  IConsole console,
  ISurface surface,
  IStyle style,
  IDrawings drawing,
  IShapes shapes,
  IImages images,
  IControls controls,
  ISounds sounds,         
  IKeyboard keyboard,
  IMouse mouse,
  ITimer timer,
  IFlickr flickr,
  ISpeech speech,
  CancellationToken token)
 {
     TextWindow.Init(console);
      Desktop.Init(surface);
      GraphicsWindow.Init(style, surface, drawing, keyboard, mouse);
      Shapes.Init(shapes);
      ImageList.Init(images);
      Turtle.Init(surface, drawing, shapes);
      Controls.Init(controls);
      Sound.Init(sounds);
      Timer.Init(timer);
      Stack.Init();
      Flickr.Init(flickr);
      Speech.Init(speech);
      Program.Init(token);
 }
コード例 #3
0
 public void Before()
 {
     this.mouse = A.Fake<IMouse>(wrapped => wrapped.Wrapping(this.CreateMouse()));
     A.CallTo(() => this.mouse.LeftDown()).Invokes(_ => { });
     A.CallTo(() => this.mouse.LeftDown(A<Coordinate>._)).Invokes(_ => { });
     Logger.Debug = Console.WriteLine;
 }
コード例 #4
0
ファイル: GameInputTests.cs プロジェクト: zakvdm/Frenetic
 public void SetUp()
 {
     stubKeyboard = MockRepository.GenerateStub<IKeyboard>();
     stubMouse = MockRepository.GenerateStub<IMouse>();
     stubKeyMapping = MockRepository.GenerateStub<IKeyMapping>();
     gameInput = new GameInput(stubKeyMapping, stubKeyboard, stubMouse);
 }
コード例 #5
0
ファイル: MouseButton.cs プロジェクト: himapo/ccm
 public MouseButton(IMouse mouse, MouseButtonLabel button)
 {
     this.mouse = mouse;
     this.button = button;
     prevPressed = false;
     nowPressed = false;
 }
コード例 #6
0
    void Start()
    {
        Mouse = MouseManager.Instance;
        //Gamepads = GamepadsManager.Instance;
        DestinationDistance = 100;

        introTrack = GetComponentsInChildren<AudioSource>()[1];
    }
コード例 #7
0
ファイル: MoveMouseAction.cs プロジェクト: RanchoLi/selenium
 /// <summary>
 /// Initializes a new instance of the <see cref="MoveMouseAction"/> class.
 /// </summary>
 /// <param name="mouse">The <see cref="IMouse"/> with which the action will be performed.</param>
 /// <param name="actionTarget">An <see cref="ILocatable"/> describing an element at which to perform the action.</param>
 public MoveMouseAction(IMouse mouse, ILocatable actionTarget)
     : base(mouse, actionTarget)
 {
     if (actionTarget == null)
     {
         throw new ArgumentException("Must provide a location for a move action.", "actionTarget");
     }
 }
コード例 #8
0
ファイル: Actions.cs プロジェクト: akiellor/selenium
 /// <summary>
 /// Initializes a new instance of the <see cref="Actions"/> class.
 /// </summary>
 /// <param name="driver">The <see cref="IWebDriver"/> object on which the actions built will be performed.</param>
 public Actions(IWebDriver driver)
 {
     IHasInputDevices inputDevicesDriver = driver as IHasInputDevices;
     if (inputDevicesDriver != null)
     {
         this.keyboard = inputDevicesDriver.Keyboard;
         this.mouse = inputDevicesDriver.Mouse;
     }
 }
コード例 #9
0
 internal WindowRelativeMouse(IntPtr parenthWnd, IntPtr hWnd, IMouse mouse, INativeMethodWrapper nativeMethodWrapper, IRetrier retry, Settings settings = null)
 {
     this.parenthWnd = parenthWnd;
     this.hWnd = hWnd;
     this.absoluteMouse = mouse;
     this.nativeMethodWrapper = nativeMethodWrapper;
     this.retry = retry;
     this.settings = settings ?? new Settings();
 }
コード例 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DefaultActionSequenceBuilder"/> class.
 /// </summary>
 /// <param name="driver">The <see cref="IWebDriver"/> object on which the actions built will be performed.</param>
 public DefaultActionSequenceBuilder(IWebDriver driver)
 {
     IHasInputDevices inputDevicesDriver = driver as IHasInputDevices;
     if (inputDevicesDriver != null)
     {
         this.keyboard = inputDevicesDriver.Keyboard;
         this.mouse = inputDevicesDriver.Mouse;
     }
 }
コード例 #11
0
        public void Before()
        {
            this.hWnd = new IntPtr(1337);
            this.innerMouse = A.Fake<IMouse>();
            this.nativeMethodWrapper = A.Fake<INativeMethodWrapper>();
            this.retrierFactory = new NRetryTimerFactory(0);
            this.retrier = new Retrier(this.retrierFactory);

            this.windowRelativeMouse = new WindowRelativeMouse(this.hWnd, this.hWnd, this.innerMouse, this.nativeMethodWrapper, this.retrier);
        }
コード例 #12
0
ファイル: SingleKeyAction.cs プロジェクト: RanchoLi/selenium
        /// <summary>
        /// Initializes a new instance of the <see cref="SingleKeyAction"/> class.
        /// </summary>
        /// <param name="keyboard">The <see cref="IKeyboard"/> to use in performing the action.</param>
        /// <param name="mouse">The <see cref="IMouse"/> to use in setting focus to the element on which to perform the action.</param>
        /// <param name="actionTarget">An <see cref="ILocatable"/> object providing the element on which to perform the action.</param>
        /// <param name="key">The modifier key (<see cref="Keys.Shift"/>, <see cref="Keys.Control"/>, <see cref="Keys.Alt"/>) to use in the action.</param>
        protected SingleKeyAction(IKeyboard keyboard, IMouse mouse, ILocatable actionTarget, string key)
            : base(keyboard, mouse, actionTarget)
        {
            if (!ModifierKeys.Contains(key))
            {
                throw new ArgumentException("key must be a modifier key (Keys.Shift, Keys.Control, or Keys.Alt)", "key");
            }

            this.key = key;
        }
コード例 #13
0
ファイル: Actions.cs プロジェクト: ankitson/Selenium2
        /// <summary>
        /// Initializes a new instance of the <see cref="Actions"/> class.
        /// </summary>
        /// <param name="driver">The <see cref="IWebDriver"/> object on which the actions built will be performed.</param>
        public Actions(IWebDriver driver)
        {
            IHasInputDevices inputDevicesDriver = driver as IHasInputDevices;
            if (inputDevicesDriver == null)
            {
                throw new ArgumentException("The IWebDriver object must implement IHasInputDevices.", "driver");
            }

            this.keyboard = inputDevicesDriver.Keyboard;
            this.mouse = inputDevicesDriver.Mouse;
        }
コード例 #14
0
        public void OnMouseClick(IMouse mouse, Point location)
        {
            switch (_state)
            {
                case State.WaitLineBeginPoint:
                    _begin = location;
                    _state = State.WaitLineEndPoint;
                    break;

                case State.WaitLineEndPoint:
                    _end = location;
                    _state = State.WaitLineBeginPoint;
                    mouse.DrawPad.Add(new Line(_begin, _end));
                    break;
            }
        }
コード例 #15
0
ファイル: MoveToHandler.cs プロジェクト: leeaa/winappdriver
 public MoveToHandler(IMouse mouse, IElementFactory elementFactory)
 {
     this.mouse = mouse;
     this.elementFactory = elementFactory;
 }
コード例 #16
0
 public ClickElementHandler(IMouse mouse, IOverlay overlay, IElementFactory elementFactory)
 {
     this.mouse = mouse;
     this.overlay = overlay;
     this.elementFactory = elementFactory;
 }
コード例 #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SendKeysAction"/> class.
 /// </summary>
 /// <param name="keyboard">The <see cref="IKeyboard"/> to use in performing the action.</param>
 /// <param name="mouse">The <see cref="IMouse"/> to use in setting focus to the element on which to perform the action.</param>
 /// <param name="actionTarget">An <see cref="ILocatable"/> object providing the element on which to perform the action.</param>
 /// <param name="keysToSend">The key sequence to send.</param>
 public SendKeysAction(IKeyboard keyboard, IMouse mouse, ILocatable actionTarget, string keysToSend)
     : base(keyboard, mouse, actionTarget)
 {
     this.keysToSend = keysToSend;
 }
コード例 #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Mouse"/> class.
 /// </summary>
 /// <param name="assets">The asset manager for this user interface module.</param>
 /// <param name="core">The basic core functionalities of the mouse unit.</param>
 public Mouse(AssetManager assets, IMouse core)
 {
     this.Assets = assets;
     Mouse.core  = core;
 }
コード例 #19
0
 private void ReleaseInterfaces()
 {
     Maze = null;
     Mouse = null;
 }
コード例 #20
0
 private void ReleaseInterfaces()
 {
     Maze  = null;
     Mouse = null;
 }
コード例 #21
0
ファイル: Program.cs プロジェクト: radobot/Silk.NET
 private static unsafe void OnMouseWheel(IMouse mouse, ScrollWheel scrollWheel)
 {
     //We don't want to be able to zoom in too close or too far away so clamp to these values
     CameraZoom = Math.Clamp(CameraZoom - scrollWheel.Y, 1.0f, 45f);
 }
コード例 #22
0
ファイル: Program.cs プロジェクト: KangWeon/Silk.NET
 private static unsafe void OnMouseWheel(IMouse mouse, ScrollWheel scrollWheel)
 {
     Camera.ModifyZoom(scrollWheel.Y);
 }
コード例 #23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MoveToOffsetAction"/> class.
 /// </summary>
 /// <param name="mouse">The <see cref="IMouse"/> with which the action will be performed.</param>
 /// <param name="actionTarget">An <see cref="ILocatable"/> describing an element at which to perform the action.</param>
 /// <param name="offsetX">The horizontal offset from the origin of the target to which to move the mouse.</param>
 /// <param name="offsetY">The vertical offset from the origin of the target to which to move the mouse.</param>
 public MoveToOffsetAction(IMouse mouse, ILocatable actionTarget, int offsetX, int offsetY)
     : base(mouse, actionTarget)
 {
     this.offsetX = offsetX;
     this.offsetY = offsetY;
 }
コード例 #24
0
 public MouseRegionWidget(IMouse mouse)
 {
     this.mouse = mouse;
     this.SubscribeToEvents();
 }
コード例 #25
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="ClickAndHoldAction" /> class.
 /// </summary>
 /// <param name="mouse">The <see cref="IMouse" /> with which the action will be performed.</param>
 /// <param name="actionTarget">An <see cref="ILocatable" /> describing an element at which to perform the action.</param>
 public ClickAndHoldAction(IMouse mouse, ILocatable actionTarget) : base(mouse, actionTarget)
 {
 }
コード例 #26
0
        public FiftyBird(IGameLoop gameLoop, IGraphics graphics, IAudio audio, IKeyboard keyboard, IMouse mouse) : base(nameof(FiftyBird), gameLoop, graphics, audio, keyboard, mouse)
        {
            Keyboard = new StatefulKeyboard(keyboard);
            Mouse    = new StatefulMouse(mouse);

            // initialize state machine with all state - returning functions
            StateMachine = new StateMachine(new Dictionary <string, State>
            {
                ["title"]     = new TitleScreenState(),
                ["countdown"] = new CountdownState(),
                ["play"]      = new PlayState(),
                ["score"]     = new ScoreState()
            });

            Instance = this;
        }
コード例 #27
0
ファイル: Program.cs プロジェクト: mcavanagh/Silk.NET
 private static void MouseOnClick(IMouse arg1, MouseButton arg2)
 {
     Console.WriteLine($"M{arg1.Index}> {arg2} single click.");
 }
コード例 #28
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ContextClickAction"/> class.
 /// </summary>
 /// <param name="mouse">The <see cref="IMouse"/> with which the action will be performed.</param>
 /// <param name="actionTarget">An <see cref="ILocatable"/> describing an element at which to perform the action.</param>
 public ContextClickAction(IMouse mouse, ILocatable actionTarget)
     : base(mouse, actionTarget)
 {
 }
コード例 #29
0
 public RunnerGame(IMouse mouse, IKeyboard keyboard)
     : base(mouse, keyboard)
 {
 }
コード例 #30
0
 /// <summary>
 /// Initializes a new instance of the <see cref="KeyboardAction"/> class.
 /// </summary>
 /// <param name="keyboard">The <see cref="IKeyboard"/> to use in performing the action.</param>
 /// <param name="mouse">The <see cref="IMouse"/> to use in setting focus to the element on which to perform the action.</param>
 /// <param name="actionTarget">An <see cref="ILocatable"/> object providing the element on which to perform the action.</param>
 protected KeyboardAction(IKeyboard keyboard, IMouse mouse, ILocatable actionTarget)
     : base(actionTarget)
 {
     this.keyboard = keyboard;
     this.mouse    = mouse;
 }
コード例 #31
0
ファイル: KeyDownAction.cs プロジェクト: asynchrony/Selenium2
 /// <summary>
 /// Initializes a new instance of the <see cref="KeyDownAction"/> class.
 /// </summary>
 /// <param name="keyboard">The <see cref="IKeyboard"/> to use in performing the action.</param>
 /// <param name="mouse">The <see cref="IMouse"/> to use in setting focus to the element on which to perform the action.</param>
 /// <param name="actionTarget">An <see cref="ILocatable"/> object providing the element on which to perform the action.</param>
 /// <param name="key">The modifier key (<see cref="Keys.Shift"/>, <see cref="Keys.Control"/>, <see cref="Keys.Alt"/>) to use in the action.</param>
 public KeyDownAction(IKeyboard keyboard, IMouse mouse, ILocatable actionTarget, string key)
     : base(keyboard, mouse, actionTarget, key)
 {
 }
コード例 #32
0
 /// <summary>
 /// Initializes a new instance of the <see cref="KeyDownAction"/> class.
 /// </summary>
 /// <param name="keyboard">The <see cref="IKeyboard"/> to use in performing the action.</param>
 /// <param name="mouse">The <see cref="IMouse"/> to use in setting focus to the element on which to perform the action.</param>
 /// <param name="actionTarget">An <see cref="ILocatable"/> object providing the element on which to perform the action.</param>
 /// <param name="key">The modifier key (<see cref="Keys.Shift"/>, <see cref="Keys.Control"/>, <see cref="Keys.Alt"/>) to use in the action.</param>
 public KeyDownAction(IKeyboard keyboard, IMouse mouse, ILocatable actionTarget, string key)
     : base(keyboard, mouse, actionTarget, key)
 {
 }
コード例 #33
0
 protected void HandleMouseUp(IMouse mouse, MouseButton btn) => MouseUp?.Invoke(mouse, btn);
コード例 #34
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ButtonReleaseAction"/> class.
 /// </summary>
 /// <param name="mouse">The <see cref="IMouse"/> with which the action will be performed.</param>
 /// <param name="actionTarget">An <see cref="ILocatable"/> describing an element at which to perform the action.</param>
 public ButtonReleaseAction(IMouse mouse, ILocatable actionTarget)
     : base(mouse, actionTarget)
 {
 }
コード例 #35
0
 /// <summary>
 ///     Initializes a new instance of the <see cref = "DoubleClickAction"/> class.
 /// </summary>
 /// <param name = "mouse">The <see cref = "IMouse"/> with which the action will be performed.</param>
 /// <param name = "actionTarget">An <see cref = "ILocatable"/> describing an element at which to perform the action.</param>
 public DoubleClickAction(IMouse mouse, ILocatable actionTarget) : base(mouse, actionTarget)
 {
 }
コード例 #36
0
ファイル: MouseAction.cs プロジェクト: asynchrony/Selenium2
 /// <summary>
 /// Initializes a new instance of the <see cref="MouseAction"/> class.
 /// </summary>
 /// <param name="mouse">The <see cref="IMouse"/> with which the action will be performed.</param>
 /// <param name="target">An <see cref="ILocatable"/> describing an element at which to perform the action.</param>
 public MouseAction(IMouse mouse, ILocatable target)
     : base(target)
 {
     this.mouse = mouse;
 }
コード例 #37
0
 public void Init(IMaze maze, IMouse mouse)
 {
     Maze = maze;
     Mouse = mouse;
 }
コード例 #38
0
ファイル: MouseWheel.cs プロジェクト: himapo/ccm
 public MouseWheel(IMouse mouse)
 {
     this.mouse = mouse;
     prevWheel = 0;
 }
コード例 #39
0
        /*
         * code reference:
         * http://blogs.msdn.com/b/mattwar/archive/2005/02/11/371274.aspx
         *
         * julia's comment:
         *  1. try to identify the cycle detection / back tracking code
         *  2. Try to understand code.
         */
        public static bool FindCheese(IMouse mouse, int rows, int cols)
        {
            Cell[,] grid = new Cell[rows, cols];

            int r = 0;
            int c = 0;

            // set terminal, so we don't backtrack past the origin

            grid[r, c].prev = 4;

            while (!mouse.IsCheeseHere()) {

                byte d = grid[r,c].next;

                if (d < 4) {

                    // increment so we know what to try next

                    grid[r,c].next++;

                    // determine next relative position

                    int nr = (r + dr[d] + rows) % rows;

                    int nc = (c + dc[d] + cols) % cols;

                    // only try to move to cells we have not already visited

                    if (grid[nr,nc].next == 0 && mouse.Move((Direction)d)) {

                        r = nr;

                        c = nc;

                        // remember how to get back
                        grid[r, c].prev = (byte)((d + 2) % 4);
                    }

                }
                else {

                    // backtrack
                    d = grid[r, c].prev;

                    if (d == 4)
                        return false;

                    mouse.Move((Direction)d);

                    r = (r + dr[d] + rows) % rows;

                    c = (c + dc[d] + cols) % cols;
                }
            }

            return true;
        }
コード例 #40
0
ファイル: Placement.cs プロジェクト: AngeloYazar/Pico3-iOS
    //IGamepads Gamepads;
    void Start()
    {
        Pico.LevelChanged += Initialize;
        Initialize();

        Anchor = Instantiate(Pico.ProjectorTemplate) as GameObject;
        Anchor.name = "Anchor";
        Anchor.GetComponent<ProjectorBehaviour>().IsGizmo = true;
        Anchor.FindChild("Inner").active = false;
        Anchor.FindChild("Pyramid").active = false;
        HighlightFace = Anchor.FindChild("Highlight Face");
        HighlightFace.GetComponentInChildren<Renderer>().enabled = false;

        //Keyboard = KeyboardManager.Instance;
        //Keyboard.RegisterKey(KeyCode.W);
        //Keyboard.RegisterKey(KeyCode.S);
        //Keyboard.RegisterKey(KeyCode.R);
        //Keyboard.RegisterKey(KeyCode.Z);
        //Keyboard.RegisterKey(KeyCode.Space);
        //Keyboard.RegisterKey(KeyCode.LeftControl);
        //Keyboard.RegisterKey(KeyCode.Escape);

        Anchor.transform.position = new Vector3(0, 0, 0);

        Mouse = MouseManager.Instance;
           // Gamepads = GamepadsManager.Instance;
    }
コード例 #41
0
ファイル: KeyboardInputMap.cs プロジェクト: dea6cat/Woofer
 public KeyboardInputMap(IKeyboard keyboard, IMouse mouse)
 {
     this.keyboard = keyboard;
     this.mouse    = mouse;
 }
コード例 #42
0
ファイル: MazeEditor.cs プロジェクト: KarolPietryka/Unity-Lab
 public MazeEditor(IMazeElementProcessing _mazeElementProcessing, IMouse _mouse, IInputMouseButtons _inputButtons)
 {
     mazeElementProcessing = _mazeElementProcessing;
     Mouse        = _mouse;
     inputButtons = _inputButtons;
 }
コード例 #43
0
ファイル: Laptop.cs プロジェクト: uit2712/AdapterPattern
 public Laptop AddMouse(IMouse mouse)
 {
     _mouse = mouse;
     return(this);
 }
コード例 #44
0
ファイル: Include_LIbrary.cs プロジェクト: mrange/funbasic
 internal static void Init(
  IStyle style, 
  ISurface surface, 
  IDrawings graphics, 
  IKeyboard keyboard,      
  IMouse mouse)
 {
     _surface = surface;
      _drawings = graphics;
      _keyboard = keyboard;
      _style = style;
      _mouse = mouse;
      PenWidth = 2.0;
      BrushColor = "purple";
      PenColor = "black";
      FontSize = 12;
      FontName = "Tahoma";
 }
コード例 #45
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ButtonReleaseAction"/> class.
 /// </summary>
 /// <param name="mouse">The <see cref="IMouse"/> with which the action will be performed.</param>
 /// <param name="actionTarget">An <see cref="ILocatable"/> describing an element at which to perform the action.</param>
 public ButtonReleaseAction(IMouse mouse, ILocatable actionTarget)
     : base(mouse, actionTarget)
 {
 }
コード例 #46
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RemoteWebDriver"/> class
        /// </summary>
        /// <param name="commandExecutor">An <see cref="ICommandExecutor"/> object which executes commands for the driver.</param>
        /// <param name="desiredCapabilities">An <see cref="ICapabilities"/> object containing the desired capabilities of the browser.</param>
        public RemoteWebDriver(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
        {
            this.executor = commandExecutor;
            this.StartClient();
            this.StartSession(desiredCapabilities);
            this.mouse = new RemoteMouse(this);
            this.keyboard = new RemoteKeyboard(this);

            if (this.capabilities.HasCapability(CapabilityType.SupportsApplicationCache))
            {
                object appCacheCapability = this.capabilities.GetCapability(CapabilityType.SupportsApplicationCache);
                if (appCacheCapability is bool && (bool)appCacheCapability)
                {
                    this.appCache = new RemoteApplicationCache(this);
                }
            }

            if (this.capabilities.HasCapability(CapabilityType.SupportsLocationContext))
            {
                object locationContextCapability = this.capabilities.GetCapability(CapabilityType.SupportsLocationContext);
                if (locationContextCapability is bool && (bool)locationContextCapability)
                {
                this.locationContext = new RemoteLocationContext(this);
                }
            }

            if (this.capabilities.HasCapability(CapabilityType.SupportsWebStorage))
            {
                object webContextCapability = this.capabilities.GetCapability(CapabilityType.SupportsWebStorage);
                if (webContextCapability is bool && (bool)webContextCapability)
                {
                    this.storage = new RemoteWebStorage(this);
                }
            }
        }
コード例 #47
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MoveToOffsetAction"/> class.
 /// </summary>
 /// <param name="mouse">The <see cref="IMouse"/> with which the action will be performed.</param>
 /// <param name="actionTarget">An <see cref="ILocatable"/> describing an element at which to perform the action.</param>
 /// <param name="offsetX">The horizontal offset from the origin of the target to which to move the mouse.</param>
 /// <param name="offsetY">The vertical offset from the origin of the target to which to move the mouse.</param>
 public MoveToOffsetAction(IMouse mouse, ILocatable actionTarget, int offsetX, int offsetY)
     : base(mouse, actionTarget)
 {
     this.offsetX = offsetX;
     this.offsetY = offsetY;
 }
コード例 #48
0
 public MoveToHandler(IMouse mouse, IOverlay overlay, IElementFactory elementFactory)
 {
     this.mouse          = mouse;
     this.overlay        = overlay;
     this.elementFactory = elementFactory;
 }
コード例 #49
0
ファイル: Label.cs プロジェクト: brianjlacy/Hero6
 /// <summary>
 /// Initializes a new instance of the <see cref="Label"/> class.
 /// </summary>
 /// <param name="mouse">The mouse servicve.</param>
 /// <param name="parent">The parent.</param>
 protected Label(IMouse mouse, UserInterfaceElement parent = null)
     : base(mouse, parent)
 {
 }
コード例 #50
0
 private static void MouseOnDoubleClick(IMouse arg1, MouseButton arg2, Vector2 pos)
 {
     Console.WriteLine($"M{arg1.Index}> {arg2} double click.");
 }
コード例 #51
0
        public IFrame <IDTDanmakuAssets> GetNextFrame(IKeyboard keyboardInput, IMouse mouseInput, IKeyboard previousKeyboardInput, IMouse previousMouseInput, IDisplay <IDTDanmakuAssets> display)
        {
            /*
             *      Note that since these debug things bypass regular game logic, they may break other stuff or crash the program
             *      (Should be used for debugging / development only)
             */
            if (this.debugMode)
            {
                if (keyboardInput.IsPressed(Key.Seven))
                {
                    for (int i = 0; i < 6; i++)
                    {
                        this.gameLogic = this.gameLogic.GetNextFrame(new EmptyKeyboard(), new EmptyMouse(), new EmptyKeyboard(), new EmptyMouse());
                    }

                    if (keyboardInput.IsPressed(Key.Q))
                    {
                        for (int i = 0; i < 27; i++)
                        {
                            this.gameLogic = this.gameLogic.GetNextFrame(new EmptyKeyboard(), new EmptyMouse(), new EmptyKeyboard(), new EmptyMouse());
                        }
                    }
                }
            }

            this.gameLogic = this.gameLogic.GetNextFrame(keyboardInput, mouseInput, previousKeyboardInput, previousMouseInput);

            if (this.gameLogic.IsGameOver())
            {
                return(new GameOverFrame(fps: fps, rng: this.rng, guidGenerator: this.guidGenerator, soundVolume: this.gameLogic.GetSoundVolume(), debugMode: this.debugMode));
            }

            if (this.gameLogic.HasPlayerWon())
            {
                return(new YouWinFrame(fps: fps, rng: this.rng, guidGenerator: this.guidGenerator, soundVolume: this.gameLogic.GetSoundVolume(), debugMode: this.debugMode));
            }

            if (keyboardInput.IsPressed(Key.Esc) && !previousKeyboardInput.IsPressed(Key.Esc))
            {
                return(new GamePausedScreenFrame(frame: this, fps: this.fps, rng: this.rng, guidGenerator: this.guidGenerator, soundVolume: this.gameLogic.GetSoundVolume(), debugMode: this.debugMode));
            }

            return(this);
        }
コード例 #52
0
ファイル: Game.cs プロジェクト: BlazorHub/CS50G
        protected Game(string gameName, IGameLoop gameLoop, IGraphics graphics, IAudio audio, IKeyboard keyboard, IMouse mouse = null, IFileSystem fileSystem = null)
        {
            GameName      = gameName;
            this.gameLoop = gameLoop;
            Graphics      = graphics;
            Audio         = audio;
            Keyboard      = keyboard;
            Mouse         = mouse;
            FileSystem    = fileSystem;

            Sounds = new Dictionary <string, ISource>();
            Random = new Random();

            Instance = this;
        }
コード例 #53
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="MouseAction" /> class.
 /// </summary>
 /// <param name="mouse">The <see cref="IMouse" /> with which the action will be performed.</param>
 /// <param name="target">An <see cref="ILocatable" /> describing an element at which to perform the action.</param>
 public MouseAction(IMouse mouse, ILocatable target) : base(target)
 {
     Mouse = mouse;
 }
コード例 #54
0
 public void Init(IMaze maze, IMouse mouse)
 {
     Maze  = maze;
     Mouse = mouse;
 }
コード例 #55
0
ファイル: RemoteWebDriver.cs プロジェクト: hpandey34/selenium
 /// <summary>
 /// Initializes a new instance of the RemoteWebDriver class
 /// </summary>
 /// <param name="commandExecutor">An <see cref="ICommandExecutor"/> object which executes commands for the driver.</param>
 /// <param name="desiredCapabilities">An <see cref="ICapabilities"/> object containing the desired capabilities of the browser.</param>
 public RemoteWebDriver(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
 {
     this.executor = commandExecutor;
     this.StartClient();
     this.StartSession(desiredCapabilities);
     this.mouse = new RemoteMouse(this);
     this.keyboard = new RemoteKeyboard(this);
 }
コード例 #56
0
 private static void MouseOnMouseMove(IMouse arg1, Vector2 arg2)
 {
     Console.WriteLine($"M{arg1.Index}> Moved: {arg2}");
 }
コード例 #57
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SendKeysAction"/> class.
 /// </summary>
 /// <param name="keyboard">The <see cref="IKeyboard"/> to use in performing the action.</param>
 /// <param name="mouse">The <see cref="IMouse"/> to use in setting focus to the element on which to perform the action.</param>
 /// <param name="actionTarget">An <see cref="ILocatable"/> object providing the element on which to perform the action.</param>
 /// <param name="keysToSend">The key sequence to send.</param>
 public SendKeysAction(IKeyboard keyboard, IMouse mouse, ILocatable actionTarget, string keysToSend)
     : base(keyboard, mouse, actionTarget)
 {
     this.keysToSend = keysToSend;
 }
コード例 #58
0
 private static void MouseOnScroll(IMouse arg1, ScrollWheel arg2)
 {
     Console.WriteLine($"K{arg1.Index}> Scrolled: ({arg2.X}, {arg2.Y})");
 }
コード例 #59
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ClickAction"/> class.
 /// </summary>
 /// <param name="mouse">The <see cref="IMouse"/> with which the action will be performed.</param>
 /// <param name="actionTarget">An <see cref="ILocatable"/> describing an element at which to perform the action.</param>
 public ClickAction(IMouse mouse, ILocatable actionTarget)
     : base(mouse, actionTarget)
 {
 }
コード例 #60
0
 private static void MouseOnMouseUp(IMouse arg1, MouseButton arg2)
 {
     Console.WriteLine($"M{arg1.Index}> {arg2} up.");
 }