當前位置: 首頁>>代碼示例>>Python>>正文


Python Team.return_wins方法代碼示例

本文整理匯總了Python中team.Team.return_wins方法的典型用法代碼示例。如果您正苦於以下問題:Python Team.return_wins方法的具體用法?Python Team.return_wins怎麽用?Python Team.return_wins使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在team.Team的用法示例。


在下文中一共展示了Team.return_wins方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: playoffs

# 需要導入模塊: from team import Team [as 別名]
# 或者: from team.Team import return_wins [as 別名]
	def playoffs(teams):
		#Organize by score
		# i=0  No clue why these three lines were here. Leaving in case I remember
		# while i < 7: 
			# i += 1
		newTeams = sorted(teams, key=operator.attrgetter("wins"), reverse = True)
		playoffTeamIDs = [Team.return_id(newTeams[0]), Team.return_id(newTeams[1]), Team.return_id(newTeams[2]), Team.return_id(newTeams[3])]
		print(playoffTeamIDs)
		#Announce playoff participants (top 4 teams)
		print("The regular season has come to a close! Let's see which teams are making it to the playoffs!")
		print("The teams who reached the playoffs are: ")
		print(Team.return_wins(newTeams[0]),' - ', Team.return_losses(newTeams[0]),'   |', Team.return_name(newTeams[0]))
		print(Team.return_wins(newTeams[1]),' - ', Team.return_losses(newTeams[1]),'   |', Team.return_name(newTeams[1]))
		print(Team.return_wins(newTeams[2]),' - ', Team.return_losses(newTeams[2]),'   |', Team.return_name(newTeams[2]))
		print(Team.return_wins(newTeams[3]),' - ', Team.return_losses(newTeams[3]),'   |', Team.return_name(newTeams[3]))
		CoreGame.playoff_matches(teams, players, playoffTeamIDs)
開發者ID:Civil-JE,項目名稱:Text-Based-LCS,代碼行數:18,代碼來源:MSim.py

示例2: display_team_records

# 需要導入模塊: from team import Team [as 別名]
# 或者: from team.Team import return_wins [as 別名]
	def display_team_records(teams):
		print('Win - Loss |Team Name')
		print("===========================================League Standings===========================================")
		print(Team.return_wins(teams[0]),' - ', Team.return_losses(teams[0]),'   |', Team.return_name(teams[0]))
		print(Team.return_wins(teams[1]),' - ', Team.return_losses(teams[1]),'   |', Team.return_name(teams[1]))
		print(Team.return_wins(teams[2]),' - ', Team.return_losses(teams[2]),'   |', Team.return_name(teams[2]))
		print(Team.return_wins(teams[3]),' - ', Team.return_losses(teams[3]),'   |', Team.return_name(teams[3]))
		print(Team.return_wins(teams[4]),' - ', Team.return_losses(teams[4]),'   |', Team.return_name(teams[4]))
		print(Team.return_wins(teams[5]),' - ', Team.return_losses(teams[5]),'   |', Team.return_name(teams[5]))
		print(Team.return_wins(teams[6]),' - ', Team.return_losses(teams[6]),'   |', Team.return_name(teams[6]))
		print(Team.return_wins(teams[7]),' - ', Team.return_losses(teams[7]),'   |', Team.return_name(teams[7]))
		print ("=================================================================================================")
		return ''
開發者ID:Civil-JE,項目名稱:Text-Based-LCS,代碼行數:15,代碼來源:MSim.py

示例3: preparation

# 需要導入模塊: from team import Team [as 別名]
# 或者: from team.Team import return_wins [as 別名]

#.........這裏部分代碼省略.........
				if Team.return_funds(teams[0]) >= 500:
					if '1v1' in action.lower():
						if 'top' in action.lower():
							Player.train_player_1v1(players[0][0])
							Team.remove_funds(teams[0], 500)
						if 'mid' in action.lower():
							Player.train_player_1v1(players[0][1])
							Team.remove_funds(teams[0], 500)
						if 'jung' in action.lower():
							Player.train_player_1v1(players[0][2])
							Team.remove_funds(teams[0], 500)
						if 'carry' in action.lower():
							Player.train_player_1v1(players[0][3])
							Team.remove_funds(teams[0], 500)
						if 'sup' in action.lower():
							Player.train_player_1v1(players[0][4])
							Team.remove_funds(teams[0], 500)
					elif 'gank' in action.lower():
						if 'top' in action.lower():
							Player.train_player_gank(players[0][0])
							Team.remove_funds(teams[0], 500)
						if 'mid' in action.lower():
							Player.train_player_gank(players[0][1])
							Team.remove_funds(teams[0], 500)
						if 'jung' in action.lower():
							Player.train_player_gank(players[0][2])
							Team.remove_funds(teams[0], 500)
						if 'carry' in action.lower():
							Player.train_player_gank(players[0][3])
							Team.remove_funds(teams[0], 500)
						if 'sup' in action.lower():
							Player.train_player_gank(players[0][4])
							Team.remove_funds(teams[0], 500)
					elif '2v2' in action.lower():
						if 'top' in action.lower():
							Player.train_player_2v2(players[0][0])
							Team.remove_funds(teams[0], 500)
						if 'mid' in action.lower():
							Player.train_player_2v2(players[0][1])
							Team.remove_funds(teams[0], 500)
						if 'jung' in action.lower():
							Player.train_player_2v2(players[0][2])
							Team.remove_funds(teams[0], 500)
						if 'carry' in action.lower():
							Player.train_player_2v2(players[0][3])
							Team.remove_funds(teams[0], 500)
						if 'sup' in action.lower():
							Player.train_player_2v2(players[0][4])
							Team.remove_funds(teams[0], 500)
					elif 'scrim' in action.lower():
						if 'top' in action.lower():
							Player.train_player_scrim(players[0][0])
							Team.remove_funds(teams[0], 500)
						if 'mid' in action.lower():
							Player.train_player_scrim(players[0][1])
							Team.remove_funds(teams[0], 500)
						if 'jung' in action.lower():
							Player.train_player_scrim(players[0][2])
							Team.remove_funds(teams[0], 500)
						if 'carry' in action.lower():
							Player.train_player_scrim(players[0][3])
							Team.remove_funds(teams[0], 500)
						if 'sup' in action.lower():
							Player.train_player_scrim(players[0][4])
							Team.remove_funds(teams[0], 500)						
				else:
					print("Oh no! You don't have the required funds to do this training! You currently have %d while you need 500! Try again later." % Team.return_funds(teams[0]))
			elif action.lower() == "sponsor":
				totalGames = Team.return_wins(teams[0]) + Team.return_losses(teams[0])
				if totalGames == 0:
					print("There are currently no sponsors who would like to offer you anything. Try playing a game first!")
					print ('')
					#return 0  #This breaks things?
				else:
					winRatio = Team.return_wins[0] / totalGames
					if winRatio >= 0.5 and winRatio <= 0.65:
						sponsorOffer = randint(5,10) * 50
					elif winRatio > 0.65:
						sponsorOffer = randint(5,10) * 75
					elif winRatio < 0.5:
						sponsorOffer = 250		
					if sponsorOffer > sponsorFunds:	
						print("Congratulations! You have found a new sponsor!")
						print("This sponsor will reward you %d for each game you win." % sponsorOffer)
						Team.set_sponsor_funds(teams[0], sponsorOffer)
					else:
						print('There are no sponsors who will give you a better offer than you currently have.')
						print('Tip: Having a better win-rate will give you access to better offers!')
						return sponsorFunds
			elif action.lower() == "league":
				CoreGame.display_team_records(teams)
			elif action.lower() == "team":
				CoreGame.display_player_stats(players)
			elif action.lower() == "funds":
				print('Your teams current funds are: ', Team.return_funds(teams[0]))
			elif action.lower() == "continue":
				break
			else:
				print('Whoops! I don\'t recognize that command. Try entering "Help" to see the available commands.')
			action = input("What would you like to do? Enter 'Help' to see all commands: ")
開發者ID:Civil-JE,項目名稱:Text-Based-LCS,代碼行數:104,代碼來源:MSim.py


注:本文中的team.Team.return_wins方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。