|
|
@@ -45,14 +45,29 @@ def memory_selectItem( |
|
|
|
# Deselect mismatched items |
|
|
|
# |
|
|
|
# Conditions: |
|
|
|
# 1. Two items are selected and they are of different groups |
|
|
|
# 0. Two items has just been selected |
|
|
|
# 1. The same item has been selected twice |
|
|
|
# 1. Selected items are of different groups |
|
|
|
@llm_by_value |
|
|
|
def memory_shouldDeselectMismatchedItems( |
|
|
|
c: memory_Context |
|
|
|
) -> memory_Context: |
|
|
|
if ( |
|
|
|
if not ( |
|
|
|
c.recentField == "selectedItems" and |
|
|
|
len(c.selectedItems) == 2 and |
|
|
|
len(c.selectedItems) == 2 |
|
|
|
): |
|
|
|
c.recentField = None |
|
|
|
return c |
|
|
|
|
|
|
|
if ( |
|
|
|
c.selectedItems[0] == c.selectedItems[1] |
|
|
|
): |
|
|
|
c.mismatchedItems.clear() |
|
|
|
c.mismatchedItems.append(c.selectedItems[0]) |
|
|
|
c.recentField = "mismatchedItems" |
|
|
|
return c |
|
|
|
|
|
|
|
if ( |
|
|
|
c.playfieldItems[c.selectedItems[0]] != c.playfieldItems[c.selectedItems[1]] |
|
|
|
): |
|
|
|
c.mismatchedItems.clear() |
|
|
|