Initial commit with a mostly working engine.

Basic commands are being parsed. I think the only weird part is the
'use' command because it needs to possibly target two things. A tiny
test example is provided in __main__, this will probably be broken out
later.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2021-11-18 11:31:21 -08:00
commit dd2128beb1
15 changed files with 1650 additions and 0 deletions

11
agame/util.py Normal file
View File

@@ -0,0 +1,11 @@
from typing import Iterable, Optional, TYPE_CHECKING
if TYPE_CHECKING:
from agame.item import ItemInst
def search_item_name(seq: Iterable["ItemInst"], item_name: str) -> Optional["ItemInst"]:
for item in seq:
if item.name == item_name or item_name in item.synonyms:
return item
return None