def __init__( self, astep, afpos, atpos, aresult = Result.RES_NON, aflag = 0): from Rule import isValidPos if not isValidPos( afpos ): raise ValueError( "Invalid position id %d" % ( afpos ) ) if not isValidPos( atpos ): raise ValueError( "Invalid position id %d" % ( atpos ) ) if astep < 0: raise ValueError( "Invalid step number %d" % ( astep ) ) self.step = astep self.fpos = afpos self.tpos = atpos self.flag = aflag self.result = aresult self.undo = False self.fchs = None self.tchs = None
def __init__(self, astep, afpos, atpos, aresult=Result.RES_NON, aflag=0): from Rule import isValidPos if not isValidPos(afpos): raise ValueError("Invalid position id %d" % (afpos)) if not isValidPos(atpos): raise ValueError("Invalid position id %d" % (atpos)) if astep < 0: raise ValueError("Invalid step number %d" % (astep)) self.step = astep self.fpos = afpos self.tpos = atpos self.flag = aflag self.result = aresult self.undo = False self.fchs = None self.tchs = None
def __init__(self, pos): from Rule import isValidPos if not isValidPos(pos): raise ValueError("Invalid position %d" % (pos)) self.pos = pos self.chess = None self.stat = False self.load()