fix: build warnings
This commit is contained in:
parent
61124fefd7
commit
86eb2137a3
3 changed files with 7 additions and 4 deletions
|
@ -10,8 +10,8 @@ using wtf.cluster.JoyCon.InputReports;
|
||||||
namespace ControllerSlidePresenter.GamepadReader;
|
namespace ControllerSlidePresenter.GamepadReader;
|
||||||
|
|
||||||
public class JoyConRead : IGamepadReader {
|
public class JoyConRead : IGamepadReader {
|
||||||
public event Action NextSlide;
|
public event Action? NextSlide;
|
||||||
public event Action PrevSlide;
|
public event Action? PrevSlide;
|
||||||
|
|
||||||
public async Task Read() {
|
public async Task Read() {
|
||||||
Console.OutputEncoding = Encoding.UTF8;
|
Console.OutputEncoding = Encoding.UTF8;
|
||||||
|
|
|
@ -4,8 +4,8 @@ using WiimoteLib.NetCore;
|
||||||
namespace ControllerSlidePresenter.GamepadReader;
|
namespace ControllerSlidePresenter.GamepadReader;
|
||||||
|
|
||||||
public class WiimoteRead : IGamepadReader {
|
public class WiimoteRead : IGamepadReader {
|
||||||
public event Action NextSlide;
|
public event Action? NextSlide;
|
||||||
public event Action PrevSlide;
|
public event Action? PrevSlide;
|
||||||
|
|
||||||
public async Task Read() {
|
public async Task Read() {
|
||||||
Wiimote wiimote = new();
|
Wiimote wiimote = new();
|
||||||
|
|
|
@ -16,11 +16,14 @@ public class SlideSwitcher : IDisposable {
|
||||||
|
|
||||||
public SlideSwitcher(IGamepadReader? reader) {
|
public SlideSwitcher(IGamepadReader? reader) {
|
||||||
_reader = reader;
|
_reader = reader;
|
||||||
|
if (_reader == null) return;
|
||||||
|
|
||||||
_reader.NextSlide += NextSlide;
|
_reader.NextSlide += NextSlide;
|
||||||
_reader.PrevSlide += PreviousSlide;
|
_reader.PrevSlide += PreviousSlide;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose() {
|
public void Dispose() {
|
||||||
|
if (_reader == null) return;
|
||||||
_reader.NextSlide -= NextSlide;
|
_reader.NextSlide -= NextSlide;
|
||||||
_reader.PrevSlide -= PreviousSlide;
|
_reader.PrevSlide -= PreviousSlide;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue