From 0edfc730dafa1407efdeb8a6eed4c88c21aa1963 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 19 十一月 2021 16:40:45 +0800
Subject: [PATCH] siri
---
HDL-ON_iOS/Other/Siri/VoiceShortcutDataManager.cs | 38 +++++++++++++++++++++++++++++++++++++-
1 files changed, 37 insertions(+), 1 deletions(-)
diff --git a/HDL-ON_iOS/Other/Siri/VoiceShortcutDataManager.cs b/HDL-ON_iOS/Other/Siri/VoiceShortcutDataManager.cs
index 041374d..98ba68b 100644
--- a/HDL-ON_iOS/Other/Siri/VoiceShortcutDataManager.cs
+++ b/HDL-ON_iOS/Other/Siri/VoiceShortcutDataManager.cs
@@ -8,6 +8,7 @@
using System;
using Intents;
using System.Linq;
+using HDLSceneSiri;
namespace Other.Siri
{
@@ -20,11 +21,16 @@
UpdateVoiceShortcuts(null);
}
+ public VoiceShortcutDataManager(Action action)
+ {
+ UpdateVoiceShortcuts(action);
+ }
+
public INVoiceShortcut VoiceShortcutForOrder(SiriScene ss)
{
var voiceShortcut = VoiceShortcuts.FirstOrDefault((shortcut) =>
{
- var intent = shortcut.Shortcut.Intent as HdlSiri.HDLRunSceneIntent;
+ var intent = shortcut.Shortcut.Intent as HDLRunSceneIntent;
if (intent is null) { return false; }
var orderFromIntent = SiriScene.FromOrderSoupIntent(intent);
if (orderFromIntent is null) { return false; }
@@ -33,6 +39,36 @@
return voiceShortcut;
}
+
+ public INVoiceShortcut VoiceShortcutForOrder2(SiriScene ss)
+ {
+ var voiceShortcut = VoiceShortcuts.FirstOrDefault((shortcut) =>
+ {
+ var intent = shortcut.Shortcut.Intent as HDLRunSceneIntent;
+ if (intent is null) { return false; }
+ var orderFromIntent = SiriScene.FromOrderSoupIntent(intent);
+ if (orderFromIntent is null) { return false; }
+ return ss.IsEqual(orderFromIntent);
+ });
+ return voiceShortcut;
+ }
+
+ public INVoiceShortcut FirstTemp ()
+ {
+ try
+ {
+ if(VoiceShortcuts == null)
+ {
+ UpdateVoiceShortcuts(null);
+ }
+ return VoiceShortcuts[0];
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
public void UpdateVoiceShortcuts(Action completion)
{
INVoiceShortcutCenter.SharedCenter.GetAllVoiceShortcuts((voiceShortcutsFromCenter, error) =>
--
Gitblit v1.8.0