Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pluggable operators #115

Merged
merged 15 commits into from
Apr 9, 2024
Merged

Pluggable operators #115

merged 15 commits into from
Apr 9, 2024

Conversation

nowsprinting
Copy link
Owner

@nowsprinting nowsprinting commented Apr 7, 2024

Overview

Implement pluggable Operators. The Operator includes a matcher and operating method.
When you want to perform special operations on a particular Component or GameObject, or when UI elements do not support uGUI, you can define a corresponding operator.

fixed #54

Changes

  • Add IOperator interface
  • Implements uGUI operators:UGUIClickOperator,UGUIClickAndHoldOperator,UGUITextInputOperator
  • Optimize MonkeyConfig
    • Move TouchAndHoldDelayMillis, RandomString, and RandomStringParametersStrategy to operators
    • IsReachable strategy method includes ScreenPointStrategy. So remove GetScreenPoint function from MonkeyConfig
  • Mod the operation target lottery to be performed by flatly expanding all operators

TODO

@github-actions github-actions bot added the enhancement New feature or request label Apr 7, 2024

This comment has been minimized.

@nowsprinting
Copy link
Owner Author

@Kuniwak san, please review if you have time 🙇

This comment has been minimized.

@Kuniwak
Copy link
Contributor

Kuniwak commented Apr 9, 2024

This is just a thought. Since IOperator has an IsMatch method (and I think CanOperate would be a more intuitive name, as per the comments), I wondered if it might not be necessary for Component to have something like CanClick.

README.md Outdated Show resolved Hide resolved
Runtime/Operators/IOperator.cs Outdated Show resolved Hide resolved
@nowsprinting
Copy link
Owner Author

@Kuniwak san, Thank you for your review!
I obsolesce wrapper methods (e.g., CanClick) at f100642

@nowsprinting nowsprinting marked this pull request as ready for review April 9, 2024 15:54
Copy link

github-actions bot commented Apr 9, 2024

Code Metrics Report

master (2b8260c) #115 (490a770) +/-
Coverage 71.6% 71.8% +0.2%
Code to Test Ratio 1:1.1 1:1.1 +0.0
Test Execution Time 4m30s 4m26s -4s
Details
  |                     | master (2b8260c) | #115 (490a770) |  +/-  |
  |---------------------|------------------|----------------|-------|
+ | Coverage            |            71.6% |          71.8% | +0.2% |
  |   Files             |               31 |             31 |     0 |
  |   Lines             |              694 |            705 |   +11 |
+ |   Covered           |              497 |            506 |    +9 |
+ | Code to Test Ratio  |            1:1.1 |          1:1.1 |  +0.0 |
  |   Code              |             1494 |           1540 |   +46 |
+ |   Test              |             1643 |           1720 |   +77 |
+ | Test Execution Time |            4m30s |          4m26s |   -4s |

Code coverage of files in pull request scope (85.9% → 85.8%)

Files Coverage +/-
Runtime/DefaultStrategies/DefaultReachableStrategy.cs 100.0% 0.0%
Runtime/GameObjectFinder.cs 83.0% +1.5%
Runtime/Hints/InteractiveComponentHint.cs 81.4% 0.0%
Runtime/InteractiveComponent.cs 72.6% +5.9%
Runtime/InteractiveComponentCollector.cs 78.4% 0.0%
Runtime/Monkey.cs 100.0% +1.2%
Runtime/MonkeyConfig.cs 100.0% 0.0%
Runtime/Operators/ClickOperator.cs 0.0% -88.2%
Runtime/Operators/TextInputOperator.cs 0.0% -88.2%
Runtime/Operators/TouchAndHoldOperator.cs 0.0% -91.7%
Runtime/Operators/UGUIClickAndHoldOperator.cs 92.6% +92.6%
Runtime/Operators/UGUIClickOperator.cs 89.5% +89.5%
Runtime/Operators/UGUITextInputOperator.cs 86.2% +86.2%

Reported by octocov

@nowsprinting nowsprinting merged commit 95d8ad8 into master Apr 9, 2024
8 checks passed
@nowsprinting nowsprinting deleted the feature/pluggable_operators branch April 9, 2024 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants