Browse Source

修正 PoC 中的智障邏輯問題

0x0001F36D 5 years ago
parent
commit
51de8023b3
2 changed files with 13 additions and 13 deletions
  1. 2 2
      src/Yuuna.Contracts.Test/Yuuna.Contracts.Test.csproj
  2. 11 11
      src/Yuuna/EntryPoint.cs

+ 2 - 2
src/Yuuna.Contracts.Test/Yuuna.Contracts.Test.csproj

@@ -1,4 +1,4 @@
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
     <OutputType>Library</OutputType>
@@ -21,7 +21,7 @@
   </ItemGroup>
 
   <Target Name="PostBuild" AfterTargets="PostBuildEvent">
-    <Exec Command="copy $(TargetPath) $(SolutionDir)..\Yuuna\bin\Debug\netcoreapp3.0\modules\Test" />
+    <Exec Command=":: copy $(TargetPath) $(SolutionDir)..\Yuuna\bin\Debug\netcoreapp3.0\modules\Test" />
   </Target>
 
 </Project>

+ 11 - 11
src/Yuuna/EntryPoint.cs

@@ -114,11 +114,13 @@ namespace Yuuna
     {
         public static void Main(string[] args)
         { 
+             
+
             var canResponses = new Response[]
             {
                 (Moods.Sad, "我不清楚你想做什麼 OvQ"),
                 (Moods.Sad, "我不懂你想幹嘛 QAQ"),
-                (Moods.Sad, "我不知道你是什麼意思 OHQ"),
+                (Moods.Sad, "我不知道你想幹嘛 OHQ"),
             };
 
             var antonyms = new[]
@@ -201,6 +203,11 @@ namespace Yuuna
 
                 case Status.Proposition:
                     {
+                        //我: 開
+                        //悠: 你是想要開房門嗎?
+                        //我: 對
+                        //悠: 我不知道你想幹嘛 OHQ
+
                         var sb = new StringBuilder(); 
                         var current = alternative.Matches[0];
 
@@ -226,14 +233,10 @@ namespace Yuuna
                                     interactor.OnReceive(r);
                                     goto Leave;
                                 }
-                                else
+                                else if(type.Equals(Antonym.TypeKinds.Negative))
                                     break;
                             }
-                            else
-                                goto Unknown;
                         }
-                         
-
 
                         sb.Clear();
 
@@ -263,14 +266,11 @@ namespace Yuuna
                                     interactor.OnReceive(r);
                                     goto Leave;
                                 }
-                                else
+                                else if (type.Equals(Antonym.TypeKinds.Negative))
                                     break;
                             }
-                            else
-                                goto Unknown;
                         }
-
-                        Unknown:
+                         
                         interactor.OnReceive(canResponses.RandomTakeOne()); 
 
                         Leave: