def parseData(data): aspects = data['aspects'] data['Player'] = structures.Model( "Player", data=[structures.Variable("playerName", str, "Player's Name")]) if 'timer' in aspects: import timerAspect timerAspect.install(data) data['Player'].addData(data['playerData']) data['Player'].addFunctions(data['playerFunctions']) models = [] globals = data['globals'] constants = data['constants'] animations = [] gameName = data['gameName'] for i in data.values(): if isinstance(i, structures.Model): insertModel(models, i) elif isinstance(i, structures.Animation): animations.append(i) if 'modelOrder' in data: models = [data[i] for i in data['modelOrder']] return { 'models': models, 'globals': globals, 'constants': constants, 'animations': animations, 'aspects': aspects, 'gameName': gameName }
def parseData(): aspects = data.aspects if 'timer' in aspects: import timerAspect timerAspect.install(data) models = [] globals = data.globals constants = data.constants animations = [] for i in members(data): if isinstance(i, structures.Model): insertModel(models, i) elif isinstance(i, structures.Animation): animations.append(i) return {'models':models, 'globals':globals, 'constants':constants, 'animations':animations, 'aspects':aspects}
def parseData(data): aspects = data['aspects'] data['Player'] = structures.Model("Player", data=[structures.Variable("playerName", str, "Player's Name")]) if 'timer' in aspects: import timerAspect timerAspect.install(data) data['Player'].addData(data['playerData']) data['Player'].addFunctions(data['playerFunctions']) models = [] globals = data['globals'] constants = data['constants'] animations = [] gameName = data['gameName'] for i in data.values(): if isinstance(i, structures.Model): insertModel(models, i) elif isinstance(i, structures.Animation): animations.append(i) return {'models':models, 'globals':globals, 'constants':constants, 'animations':animations, 'aspects':aspects, 'gameName':gameName}
Variable('toFile', int, 'The final file location'), Variable('toRank', int, 'The final rank location'), Variable('promoteType', int, 'The type of the piece for pawn promotion. Q=Queen, B=Bishop, N=Knight, R=Rook'), ], doc = 'A chess move', ) move = Animation('move', data = [ Variable('fromFile', int), Variable('fromRank', int), Variable('toFile', int), Variable('toRank', int), Variable('promoteType', int), ], ) globals = [ Variable('turnNumber', int, 'How many turns it has been since the beginning of the game'), Variable('playerID', int, 'Player Number; either 0 or 1'), Variable('gameNumber', int, 'What number game this is for the server'), Variable('TurnsToStalemate', int, 'How many turns until the game ends because no pawn has moved and no piece has been taken'), ] constants = [ Variable('player0Name', str, 'Player 0\'s name'), Variable('player1Name', str, 'Player 1\'s name'), ] import timerAspect timerAspect.install()