1
0

chore: update example

This commit is contained in:
2026-06-02 15:40:00 +08:00
parent c43d15afa0
commit af2d264346
2 changed files with 10 additions and 44 deletions
+10 -4
View File
@@ -1,5 +1,4 @@
import logging
from signal import pause
from sqlalchemy import create_engine
from sqlalchemy.orm import Session
@@ -7,13 +6,20 @@ from star_resonance_tracer.proto.enum_chit_chat_channel_type_pb2 import ChitChat
from inventory_wars.game import Game
from inventory_wars.models import Base
from inventory_wars.scoring import FirstGuess, HighestAmount
logging.basicConfig(level=logging.INFO)
engine = create_engine("sqlite:///app.db")
Base.metadata.create_all(engine)
game = Game(Session(engine), item_id=1040202, listening_channels=[ChitChatChannelType.ChannelTeam])
game.start()
game = Game(Session(engine), listening_channels=[ChitChatChannelType.ChannelTeam])
while True:
item_id = input("Enter item id to start: ")
if not item_id:
break
pause()
game.start(int(item_id), HighestAmount())
input("Enter to end game. ")
game.end()