stop silly recursion. Implement init vers of question answering
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using DefaultNamespace;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -25,4 +26,31 @@ public class DoorManager : MonoBehaviour
|
||||
#endif
|
||||
}
|
||||
|
||||
public QuestionAnswer GetProperty(string property)
|
||||
{
|
||||
var answer = QuestionAnswer.NO_YES;
|
||||
if (property.StartsWith("safe"))
|
||||
{
|
||||
answer = type switch
|
||||
{
|
||||
"LIFE" => QuestionAnswer.YES,
|
||||
"DEATH" => QuestionAnswer.NO,
|
||||
_ => QuestionAnswer.NO_YES
|
||||
};
|
||||
}
|
||||
|
||||
if (property.EndsWith("!"))
|
||||
{
|
||||
//we want opposite, so switch
|
||||
return answer switch
|
||||
{
|
||||
QuestionAnswer.YES => QuestionAnswer.NO,
|
||||
QuestionAnswer.NO => QuestionAnswer.YES,
|
||||
QuestionAnswer.NO_YES => QuestionAnswer.NO_YES // i think? since we cannot confidently lie?
|
||||
};
|
||||
}
|
||||
|
||||
//else return base
|
||||
return answer;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user