25 lines
		
	
	
	
		
			551 B
		
	
	
	
		
			Python
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
	
		
			551 B
		
	
	
	
		
			Python
		
	
	
		
			Executable file
		
	
	
	
	
| #!/usr/bin/env python3
 | |
| from hra.game import logic_by_mode
 | |
| import hra.db as db
 | |
| import hra.lib as lib
 | |
| 
 | |
| import sys
 | |
| from sqlalchemy import exc, update
 | |
| 
 | |
| 
 | |
| mode = "occupy"
 | |
| teams_count = 6
 | |
| configuration = {}
 | |
| g = db.Game(game_mode=mode, configuration=configuration, teams_count=teams_count)
 | |
| 
 | |
| db.get_session().add(g)
 | |
| db.get_session().commit()
 | |
| 
 | |
| s = db.State(game_id=g.game_id, round=0, state=g.get_logic().zero_state())
 | |
| 
 | |
| db.get_session().add(s)
 | |
| g.current_round = 0
 | |
| g.working_on_next_state = False
 | |
| db.get_session().commit()
 | |
| 
 | |
| print(f"Přidána hra {g.game_id}. ")
 |