下载此文档

页游开发中的Python 组件与模式.ppt


文档分类:IT计算机 | 页数:约56页 举报非法文档有奖
1/56
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/56 下载此文档
文档列表 文档介绍
页游开发中的 Python 组件与模式
赖勇浩()
2012-10-21
去年我来过……
回顾……
幻灯:yonghao/python-webgame-10452102
录像(上海45分钟版):http://e./v_3df867_14
录像(广州91分钟版):http://v./v_playlist/
偏向于“最佳实践”的经验分享
今天不一样……
直奔主题!
class Player(object):
def signin(self, usr, pwd):
...
= True
def do_sth(self):
if not :
()
return
...
有什么问题?
def do_sth_1(...
def do_sth_2(...
def do_sth_3(...
def do_sth_4(...

一般这样解决掉……
***@ensure_signin
def do_sth(self, *a, **kw):

Decorator !!!
还有什么问题?
def do_sth_1(...
def do_sth_2(...
def do_sth_3(...
def do_sth_4(...

if not : ...
if not : ...
if not : ...
...
还是这样解决掉?
***@ensure_signin
***@ensure_in_battle
***@ensuer_is_alive
def do_sth(self, *a, **kw):

???
好像哪里不对……
戴太多“帽子”不好看
method 的数量没有减少。
需要一点新思路!

页游开发中的Python 组件与模式 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数56
  • 收藏数0 收藏
  • 顶次数0
  • 上传人zbfc1172
  • 文件大小647 KB
  • 时间2018-06-27
最近更新