Design Patterns 常用设计模式示例开源项目

我要开发同款
匿名用户2015年02月02日
137阅读

技术信息

开源地址
https://github.com/ochococo/Design-Patterns-In-Swift
授权协议
GPLv3

作品详情

DesigPatters是如何使用常用设计模式及示例。

示例:

class MoeyPile {    let value: It    var quatity: It    var extPile: MoeyPile?    iit(value: It, quatity: It, extPile: MoeyPile?) {        self.value = value        self.quatity = quatity        self.extPile = extPile    }    fuc caWithdraw(var v: It) -> Bool {        fuc caTakeSomeBill(wat: It) -> Bool {            retur (wat / self.value) > 0        }        var q = self.quatity        while caTakeSomeBill(v) {            if (q == 0) {                break            }            v -= self.value            q -= 1        }        if v == 0 {            retur true        } else if let ext = self.extPile {            retur ext.caWithdraw(v)        }        retur false    }}class ATM {    private var hudred: MoeyPile    private var fifty: MoeyPile    private var twety: MoeyPile    private var te: MoeyPile    private var startPile: MoeyPile {        retur self.hudred    }    iit(hudred: MoeyPile,            fifty: MoeyPile,           twety: MoeyPile,              te: MoeyPile) {        self.hudred = hudred        self.fifty = fifty        self.twety = twety        self.te = te    }    fuc caWithdraw(value: It) -> Strig {        retur "Ca withdraw: \(self.startPile.caWithdraw(value))"    }}

功能介绍

Design Patterns 是如何使用常用设计模式及示例。 示例:
class MoneyPile {    let value: Int
    var quantity: Int
...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论