2022-04-19 23:22:44 +02:00
|
|
|
from os import stat
|
|
|
|
from re import S
|
|
|
|
from acts import *
|
|
|
|
|
|
|
|
|
|
|
|
def check_condition(state, conditions, type=all):
|
|
|
|
if type(i in state for i in conditions):
|
|
|
|
return True
|
|
|
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
2022-04-19 22:53:05 +02:00
|
|
|
def taktyka_dialogu(state):
|
2022-04-19 23:22:44 +02:00
|
|
|
if should_respond_gently(state):
|
|
|
|
return [hello_act, name_response_act]
|
|
|
|
if should_prompt(state):
|
2022-04-20 10:21:57 +02:00
|
|
|
return [hello_act, help_response_act]
|
2022-04-19 23:22:44 +02:00
|
|
|
if should_respond_cold(state):
|
|
|
|
return [name_response_act]
|
|
|
|
return [unknown_act]
|
|
|
|
|
|
|
|
|
|
|
|
def should_respond_gently(state):
|
|
|
|
return check_condition(state, [hello_act, name_request_act])
|
|
|
|
|
|
|
|
|
|
|
|
def should_prompt(state):
|
|
|
|
return check_condition(state, [hello_act], any)
|
|
|
|
|
|
|
|
|
|
|
|
def should_respond_cold(state):
|
|
|
|
return check_condition(state, [name_request_act])
|