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:
11
agame/util.py
Normal file
11
agame/util.py
Normal 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
|
||||
Reference in New Issue
Block a user