forked from okreng/risk_learning
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplayer.py
More file actions
32 lines (26 loc) · 841 Bytes
/
player.py
File metadata and controls
32 lines (26 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from abc import ABC, abstractmethod
from board import Territory
class Player(ABC):
def __init__(self):
"""
Initializes variables all subclasses of player should have
"""
self.unallocated_armies = 0
@abstractmethod
def get_attacks(self, valid):
""" Decide what to attack
:return (Territory, Territory): (territory to attack from, territory to attack)
"""
return
@abstractmethod
def get_fortifications(self, valid):
""" Decide where to fortify
:return (Territory, Territory, int): (territory_from, territory_to, num to add)
"""
return
@abstractmethod
def get_allotments(self, valid):
""" Should return tuple of (territory, num_to_allot)
:return (Territory, int)
"""
return