Exemple #1
0
 def focus_previous(self):
     if self.visible == 1 and self.focus_idx > 0:
         dispatcher.send(GUIEvent.FocusCard())
         self.focus_dir = -1
         self.focus_idx += self.focus_dir
         self.layout()
         return True
     else: return False
Exemple #2
0
 def focus_next(self):
     if self.visible == 1 and self.focus_idx < len(self)-1:
         dispatcher.send(GUIEvent.FocusCard())
         self.focus_dir = 1
         self.focus_idx += self.focus_dir
         self.layout()
         return True
     else: return False
Exemple #3
0
 def focus_previous(self):
     dir = 1
     if dir == 1: cond = self.focus_idx > 0
     else: cond = self.focus_idx < len(self)-1
     if cond: #self.focus_idx > 0:
         dispatcher.send(GUIEvent.FocusCard())
         self.focus_dir = -dir
         self.focus_idx += self.focus_dir
         self.layout()
         return True
     else: return False
Exemple #4
0
 def focus_next(self):
     dir = 1
     if dir == 1: cond = (self.focus_idx < len(self)-1)
     else: cond = self.focus_idx > 0
     if cond: #self.focus_idx < len(self)-1:
         dispatcher.send(GUIEvent.FocusCard())
         self.focus_dir = dir
         self.focus_idx += self.focus_dir
         self.layout()
         return True
     else: return False
Exemple #5
0
 def priority_stop(self, player):
     # XXX This and the play_ability function won't work until i can properly put events
     # onto the event queue
     if Keeper.stack.empty():
         if (not self.p1_stop_next and
            ((player != Keeper.active_player and self.phase_status.check_opponent_stop()) or
             (player == Keeper.active_player and self.phase_status.check_my_stop()))):
             self.pending_actions.append(engine.Action.PassPriority())
         elif self.finish_turn:
             self.pending_actions.append(engine.Action.PassPriority())
             return
     if (player == self.player1):
         #self.player_hand.set_hidden(False)
         #self.otherplayer_hand.set_hidden(True)
         dispatcher.send(GUIEvent.MyPriority())
     else:
         #self.player_hand.set_hidden(True)
         #self.otherplayer_hand.set_hidden(False)
         dispatcher.send(GUIEvent.OpponentPriority())
Exemple #6
0
 def priority_stop(self, player):
     # XXX This and the play_ability function won't work until i can properly put events
     # onto the event queue
     if Keeper.stack.empty():
         if (not self.p1_stop_next and
            ((player != Keeper.active_player and self.phase_status.check_opponent_stop()) or
             (player == Keeper.active_player and self.phase_status.check_my_stop()))):
             self.pending_actions.append(engine.Action.PassPriority())
         elif self.finish_turn:
             self.pending_actions.append(engine.Action.PassPriority())
             return
     if (player == self.player1):
         #self.player_hand.set_hidden(False)
         #self.otherplayer_hand.set_hidden(True)
         dispatcher.send(GUIEvent.MyPriority())
     else:
         #self.player_hand.set_hidden(True)
         #self.otherplayer_hand.set_hidden(False)
         dispatcher.send(GUIEvent.OpponentPriority())