Doc comments and stuff
This commit is contained in:
		
							parent
							
								
									54568d70c2
								
							
						
					
					
						commit
						7b747fb4d3
					
				
					 3 changed files with 8 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -1,2 +1 @@
 | 
			
		|||
#!/usr/bin/env python3
 | 
			
		||||
# Eryn Wells <eryn@erynwells.me>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -78,7 +78,10 @@ def main(argv):
 | 
			
		|||
                engine.handle_event(event)
 | 
			
		||||
 | 
			
		||||
def run_until_exit():
 | 
			
		||||
    '''Run the package's main() and call sys.exit when it finishes.'''
 | 
			
		||||
    '''
 | 
			
		||||
    Run main() and call sys.exit when it finishes. In practice, this function will never return. The game engine has
 | 
			
		||||
    other mechanisms for exiting.
 | 
			
		||||
    '''
 | 
			
		||||
    result = main(sys.argv)
 | 
			
		||||
    sys.exit(0 if not result else result)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,7 @@
 | 
			
		|||
#!/usr/bin/env python3
 | 
			
		||||
# Eryn Wells <eryn@erynwells.me>
 | 
			
		||||
 | 
			
		||||
'''Defines event handling mechanisms.'''
 | 
			
		||||
 | 
			
		||||
from typing import Optional
 | 
			
		||||
 | 
			
		||||
import tcod
 | 
			
		||||
| 
						 | 
				
			
			@ -9,6 +10,8 @@ from .actions import Action, ExitAction, RegenerateRoomsAction, BumpAction
 | 
			
		|||
from .geometry import Direction
 | 
			
		||||
 | 
			
		||||
class EventHandler(tcod.event.EventDispatch[Action]):
 | 
			
		||||
    '''Handler of `tcod` events'''
 | 
			
		||||
 | 
			
		||||
    def ev_quit(self, event: tcod.event.Quit) -> Optional[Action]:
 | 
			
		||||
        return ExitAction()
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue