def transferToStock(player): global targetCount targetCount = 0 for i in range(nbPlayers): bids[i].setTargetArea(TargetArea(stockLocations[player])) card = bids[i].getLast() if card == None: continue card.setVerso(True) bids[i].transferNonBlocking(card, stocks[player], True) Monitor.putSleep() stocks[player].draw()
def mouseEvent(self, mouse): Monitor.wakeUp() return True
sequence3 = hand.extractSequences(Suit.HEARTS, 3) for i in range(len(sequence3)): sequence3[i].setView(cg, RowLayout(Location(70 + 150 * i, 230), 120)) sequence3[i].draw() sequence4 = hand.extractSequences(Suit.HEARTS, 4) for i in range(len(sequence4)): sequence4[i].setView(cg, RowLayout(Location(70 + 150 * i, 380), 120)) sequence4[i].draw() sequence5 = hand.extractSequences(Suit.HEARTS, 5) for i in range(len(sequence5)): sequence5[i].setView(cg, RowLayout(Location(100 + 200 * i, 530), 150)) sequence5[i].draw() cg.setStatusText("Click to generate the next card set."); Monitor.putSleep() if cg.isDisposed(): break # Cleanup all hands hand.removeAll(False) for h in sequence3: h.removeAll(False) for h in sequence4: h.removeAll(False) for h in sequence5: h.removeAll(False)
def atTarget(self, card, loc): global targetCount targetCount += 1 if targetCount == nbPlayers: Monitor.wakeUp() # All cards in stock->continue
def wakeUp(): Monitor.wakeUp()
def putSleep(): Monitor.putSleep()
def collide(self, actor1, actor2): gg.setMouseEnabled(False) # Inhibit further mouse events Monitor.wakeUp() # Resume processing return 0