player module¶
Implement and use AI players in matches.
Custom AI players may subclass Player and implement
Player.get_attack_areas() to offer a consistent interface
to game engines.
-
class
dicewars.player.Player¶ Base class for AI players.
-
get_attack_areas(grid, match_state, *args, **kwargs)¶ Choose (valid) areas for a
Matchattack.Override this method in subclasses. It is provided with full
Gridand matchStateinformation (and optional user data). If there is an attack possible and wanted, return a pair of attacking/attacked areas.- Parameters
- Returns
indices of attacking and attacked areas, None to not attack
- Return type
tuple(int, int) or None
-