mirror of
https://github.com/neogeek23/Dominion-Strategy-Simulator.git
synced 2026-02-04 11:08:18 +00:00
Delete hand.py
This commit is contained in:
parent
1b9468e878
commit
6aeb4281fa
@ -1,47 +0,0 @@
|
|||||||
from table.supply import Supply
|
|
||||||
|
|
||||||
|
|
||||||
class Hand(Supply):
|
|
||||||
def contains_one_of(self, acceptible_types):
|
|
||||||
result = False
|
|
||||||
unique_types = self.__get_unique_types()
|
|
||||||
|
|
||||||
for at in acceptible_types:
|
|
||||||
result |= at in unique_types
|
|
||||||
return result
|
|
||||||
|
|
||||||
def get_card_type_count(self, card_type):
|
|
||||||
result = 0
|
|
||||||
|
|
||||||
for c in self._Supply__card:
|
|
||||||
if c.get_type() == card_type:
|
|
||||||
result += 1
|
|
||||||
return result
|
|
||||||
|
|
||||||
def blocks_attack(self, what_attack):
|
|
||||||
yes_no = False
|
|
||||||
found_at = -1
|
|
||||||
|
|
||||||
for c in self._Supply__card:
|
|
||||||
if c.prevent_attack:
|
|
||||||
found_at = self._Supply__card.index(c)
|
|
||||||
|
|
||||||
if found_at >= 0:
|
|
||||||
yes_no = "Y" == self.__get_reveal("Player "
|
|
||||||
+ str(self._Supply__card[found_at].get_owner().get_player_index())
|
|
||||||
+ ", enter 'Y' if you'd like to reveal "
|
|
||||||
+ self._Supply__card[found_at].get_name() + " to block the "
|
|
||||||
+ what_attack + " attack: ")
|
|
||||||
return yes_no
|
|
||||||
|
|
||||||
def __get_reveal(self, message):
|
|
||||||
return input(message)
|
|
||||||
|
|
||||||
def __get_unique_types(self):
|
|
||||||
unique_type = list()
|
|
||||||
|
|
||||||
for c in self._Supply__card:
|
|
||||||
current_type = c.get_type()
|
|
||||||
if not current_type in unique_type:
|
|
||||||
unique_type.append(current_type)
|
|
||||||
return unique_type
|
|
||||||
Loading…
x
Reference in New Issue
Block a user