zoukankan      html  css  js  c++  java
  • 常用的设计模式

    常用的设计模式
    `

            let TankFactor = {
            tankList: {
                "01": function() {
                    const img = new Image(); 
                    img.src = "./images/01.jpg";
                    return img;
                },
                "02": function() {
                    const img = new Image(); // 创建一张图片
                    img.src = "./images/02.jpg";
                    return img;
                },
                "03": function() {
                    const img = new Image(); 
                    img.src = "./images/03.jpg";
                    return img;
                },
                "04": function() {
                    const img = new Image(); 
                    img.src = "./images/04.jpg";
                    return img;
                }
            },
            create: function(type) { // 通过create来创建坦克 
                let info = this.tankList[type]();    // this.tankList['01']
                return info;
            }
        }
        let v1 = TankFactor.create('02');
        document.body.appendChild(v1);
    
    
  • 相关阅读:
    poj 1286 Necklace of Beads poj 2409 Let it Bead HDU 3923 Invoker <组合数学>
    大圣降妖录破解
    dex文件格式二
    dex文件格式一
    打造smali代码库辅助分析
    一键调试脚本使用手册
    TraceView进行性能分析
    Android Killer工具用法
    十三. JEB破解三
    十二. 一步步破解JEB 2.0demo版二
  • 原文地址:https://www.cnblogs.com/lyly96720/p/12526840.html
Copyright © 2011-2022 走看看