コード例 #1
0
ファイル: war.py プロジェクト: Rofy-Ray/stack-queue-war-game
 def move_my_loot(self, wn, t_turt, turt):
     """Moves everything from lootPile to myStoragePile"""
     while self.lootPile.size() != 0:                        # removes all the cards from the lootpile and puts them into the storage pile
         a = self.lootPile.pop()
         self.myStoragePile.enqueue(a)
         Display.user_storage(self, wn, turt)                # displays user storage pile
     t_turt.clear()
     Display.user_storage_number(self, wn, t_turt, self.myStoragePile.size())    # displays number of cards in storage
     return self.myStoragePile
コード例 #2
0
ファイル: war.py プロジェクト: Rofy-Ray/stack-queue-war-game
 def move_my_storage(self, wn, u_turt, t_turt, s_turt):
     """Moves everything from myStoragePile to myPlayingPile"""
     if self.myPlayingPile.size() == 0:
         while self.myStoragePile.size() != 0:                   # removes all the cards from the storage pile and puts it into the playing hand
             c = self.myStoragePile.dequeue()
             self.myPlayingPile.push(c)
         if self.myStoragePile.size()== 0:
             return self.myPlayingPile
         else:
             u_turt.clear()
             Display.user_card_number(self, wn, u_turt, self.myPlayingPile.size())   # updated user card number
             Display.replace_card(self, wn, s_turt)                              # moves the storage to the playing pile
             t_turt.clear()
             Display.user_storage_number(self, wn, t_turt, self.myStoragePile.size())    # updates storage pile number
             s_turt.clear()
             return self.myPlayingPile