gym_splendor_code/envs/mechanics/players_hand.py
def can_afford_card(self,
                        card: Card,
                        discount: GemsCollection = None) -> bool:
        """Returns true if players_hand can afford card"""
        if discount is None:
            discount = self.discount()
        price_after_discount = card.price % discount
        trade = [a - b for a, b in zip(price_after_discount.to_dict(), self.gems_possessed.to_dict())]
        return sum([max(a,0) for a in  trade[1:6]]) <= -trade[0]
Returns true if players_hand can afford card
Returns true if players_hand can afford card
Returns true if players_hand can afford card
def can_afford_card(self,
                        card: Card,
                        discount: GemsCollection = None) -> bool:
        if discount is None:
            discount = self.discount()
        price_after_discount = card.price % discount
        trade = [a - b for a, b in zip(price_after_discount.to_dict(), self.gems_possessed.to_dict())]
        return sum([max(a,0) for a in  trade[1:6]]) <= -trade[0]
def can_afford_card ( self , card : Card , discount : GemsCollection = None ) -> bool : if discount is None : discount = self . discount ( ) price_after_discount = card . price % discount trade = [ a - b for a , b in zip ( price_after_discount . to_dict ( ) , self . gems_possessed . to_dict ( ) ) ] return sum ( [ max ( a , 0 ) for a in trade [ 1 : 6 ] ] ) <= - trade [ 0 ]
Returns true if players_hand can afford card
Returns true if players_hand can afford card
"""Returns true if players_hand can afford card"""
self
card
Card
discount
GemsCollection