-
Notifications
You must be signed in to change notification settings - Fork 3
[outdated] ControllerManagement for iOS #168
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
Changes from all commits
67940f6
436546c
56eaa80
1ba447b
9956cee
220ec02
510a368
5373ae0
aff7c47
47ea406
86b8d19
e3e78a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ | |
|
|
||
| namespace BrickController2.Windows.PlatformServices.GameController; | ||
|
|
||
| internal class GameControllerService : GameControllerServiceBase<GamepadController>, IGameControllerService | ||
| internal class GameControllerService : GameControllerServiceBase, IGameControllerService | ||
| { | ||
| private readonly IMainThreadService _mainThreadService; | ||
| private readonly IDispatcherProvider _dispatcherProvider; | ||
|
|
@@ -53,9 +53,9 @@ private void Gamepad_GamepadRemoved(object? sender, Gamepad gamepad) | |
| // ensure stopped in UI thread | ||
| _ = _mainThreadService.RunOnMainThread(() => | ||
| { | ||
| if (TryRemove(x => x.Gamepad == gamepad, out var controller)) | ||
| if (TryRemove<GamepadController>(x => x.ControllerDevice == gamepad, out var controller)) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is type of
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's because we lost the generic in the base class - it's just the interface But to distinguish the controllers we neet to handle the real type to be able to access properties not defined in the interface. If there is another remove-event for another controller type to handle - i.e. for the McpServer ;) - the generic paramater of TryRemove<> would be that special type of controller:
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I d not like this desgin as:
* additionally it seems to me in your follow up (#165), MCP platform inplementations are nearly the same. Is it?
Shortly said, it should be done differently. May be there might be some game controller providers, which are providing different types of game controllers, the gamepad ones, MCP ones. Just a quick idea.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, if I understood you correctly, I see it that way too. If I find some time these days I'll suggest an implementation of that. |
||
| { | ||
| _logger.LogInformation("Gamepad has been removed ControllerId:{controllerId}", controller.ControllerId); | ||
| _logger.LogInformation("Controller device has been removed ControllerId:{controllerId}", controller.ControllerId); | ||
| } | ||
| }); | ||
| } | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.