当前位置: 首页>>代码示例>>Python>>正文


Python Settings.getMinPay方法代码示例

本文整理汇总了Python中Settings.Settings.getMinPay方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.getMinPay方法的具体用法?Python Settings.getMinPay怎么用?Python Settings.getMinPay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Settings.Settings的用法示例。


在下文中一共展示了Settings.getMinPay方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: SetupGUI

# 需要导入模块: from Settings import Settings [as 别名]
# 或者: from Settings.Settings import getMinPay [as 别名]

#.........这里部分代码省略.........
							
		#set the payouts
		for p, sp in zip(self.payoffs, self.settings.payouts):
			p.SetValue(sp)
		
		#set the combos
		for c, sc in zip(self.allCombos, self.settings.combos):
			for cc, ssc in zip(c, sc):
				cc.SetStringSelection(ssc)

		#set the overrides
		for o, oo in zip(self.overrides, self.settings.override['odds']):
			o.SetValue(oo)

		#set the near miss odds
		for nm, nmo in zip(self.nearMissOdds, self.settings.override['nearMiss']):
			nm.SetValue(nmo)
			
		#set the override/gambler's fallacy stuff
		self.gfBox.SetValue(self.settings.gamblersFallacy)
		self.overBox.SetValue(self.settings.override['engage'])
		
		if hasattr(self.settings, 'slots'):
			#set the symbol pads
			nms = self.settings.slots.reels[0].nms
			for pad, s in zip(self.nearMisses, self.settings.visibleSymbols):
				if nms.has_key(s):
					pad.SetValue(nms[s])

		
		self.makeReels()

		#set max and min pay
		self.minPay.SetValue(str(self.settings.getMinPay()))
		self.maxPay.SetValue(str(self.settings.getMaxPay()))
		

	def makeReels(self):
		reels = {}
		for s in self.settings.visibleSymbols:
			weights = self.weights[self.settings.visibleSymbols.index(s)]
			for w in weights:
				k = str(weights.index(w))
				if reels.has_key(k):
					reels[k][s] = w.GetValue()
				else:
					reels[k] = {s : w.GetValue()}
		
		nms = {}
		for s, nm in zip(self.settings.visibleSymbols, self.nearMisses):
			nms[s] = nm.GetValue()
		
		
		self.settings.slots = Slots(reels, self.settings.visibleSymbols, nms)				
		self.updateOdds()		

	def updateOdds(self):

		self.settings.gamblersFallacy = self.gfBox.GetValue()
		self.settings.override['engage'] = self.overBox.GetValue()
				
		overrides = []
		nearMisses = []			
		
		for o, nmo in zip(self.overrides, self.nearMissOdds):
			overrides.append(o.GetValue())
开发者ID:cbattista,项目名称:CogSlots,代码行数:70,代码来源:setupgui.py


注:本文中的Settings.Settings.getMinPay方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。