예제 #1
0
파일: pgset.py 프로젝트: game-enthan/paigow
 def hands(self):
     from paigow.pghand import PGHand
     hand1 = PGHand.create_with_tile_chars(self.tiles[0].char(),
                                           self.tiles[1].char())
     hand2 = PGHand.create_with_tile_chars(self.tiles[2].char(),
                                           self.tiles[3].char())
     return hand1, hand2
예제 #2
0
파일: pgset.py 프로젝트: game-enthan/paigow
 def hand_labels(self):
     from paigow.pghand import PGHand
     high_hand = PGHand.create_with_tile_chars(self.tiles[0].char(),
                                               self.tiles[1].char())
     low_hand = PGHand.create_with_tile_chars(self.tiles[2].char(),
                                              self.tiles[3].char())
     return high_hand.label() + "|" + low_hand.label()
예제 #3
0
def data_hand_label( request, params = {} ):
  hand_chars = request.GET['hand']
  pghand = PGHand.create( PGTile.objects.get( tile_char = hand_chars[0] ), PGTile.objects.get( tile_char = hand_chars[1] ) )
  label = pghand.label()
  pghand = PGHand.create( PGTile.objects.get( tile_char = hand_chars[2] ), PGTile.objects.get( tile_char = hand_chars[3] ) )
  label = label + "|" + pghand.label()
  return HttpResponse( label )
예제 #4
0
파일: pgset.py 프로젝트: game-enthan/paigow
 def __unicode__(self):
     from paigow.pghand import PGHand
     hand1 = PGHand.create_with_tile_chars(self.tiles[0].char(),
                                           self.tiles[1].char())
     hand2 = PGHand.create_with_tile_chars(self.tiles[2].char(),
                                           self.tiles[3].char())
     return "Set: [" + str(hand1) + " ] ... [ " + str(hand2) + " ]"
예제 #5
0
def data_hand_label(request, params={}):
    hand_chars = request.GET['hand']
    pghand = PGHand.create(PGTile.objects.get(tile_char=hand_chars[0]),
                           PGTile.objects.get(tile_char=hand_chars[1]))
    label = pghand.label()
    pghand = PGHand.create(PGTile.objects.get(tile_char=hand_chars[2]),
                           PGTile.objects.get(tile_char=hand_chars[3]))
    label = label + "|" + pghand.label()
    return HttpResponse(label)
예제 #6
0
파일: pgset.py 프로젝트: game-enthan/paigow
 def ordering_with_tiles(self, i0, i1, i2, i3, tst):
     from paigow.pghand import PGHand
     return tst( PGHand.create( self.tiles[i0], self.tiles[i1] ) ) or \
            tst( PGHand.create( self.tiles[i2], self.tiles[i3] ) )
예제 #7
0
def show_hand_label( context, tile1, tile2 ):
  if ( context['player_type'] == "opponent" ):
    return "--"
  pghand = PGHand.create( tile1, tile2 )
  return pghand.label()
예제 #8
0
 def hand_labels( self ):
   from paigow.pghand import PGHand
   high_hand = PGHand.create_with_tile_chars( self.tiles[0].char(), self.tiles[1].char() )
   low_hand = PGHand.create_with_tile_chars( self.tiles[2].char(), self.tiles[3].char() )
   return high_hand.label() + "|" + low_hand.label()
예제 #9
0
 def hands( self ):
   from paigow.pghand import PGHand
   hand1 = PGHand.create_with_tile_chars( self.tiles[0].char(), self.tiles[1].char() )
   hand2 = PGHand.create_with_tile_chars( self.tiles[2].char(), self.tiles[3].char() )
   return hand1, hand2
예제 #10
0
 def __unicode__( self ):
   from paigow.pghand import PGHand
   hand1 = PGHand.create_with_tile_chars( self.tiles[0].char(), self.tiles[1].char() )
   hand2 = PGHand.create_with_tile_chars( self.tiles[2].char(), self.tiles[3].char() )
   return "Set: [" + str( hand1 ) + " ] ... [ " + str( hand2 ) + " ]"
예제 #11
0
 def ordering_with_tiles( self, i0, i1, i2, i3, tst ):
   from paigow.pghand import PGHand
   return tst( PGHand.create( self.tiles[i0], self.tiles[i1] ) ) or \
          tst( PGHand.create( self.tiles[i2], self.tiles[i3] ) )