2 Star 7 Fork 0

严家豆 / Head first 设计模式学习

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
MainTest.java 643 Bytes
一键复制 编辑 原始数据 按行查看 历史
严家豆 提交于 2022-06-09 09:31 . update: 命令模式代码更新
package OrderPattern.first;
import OrderPattern.first.fuction.CeilingFan;
import OrderPattern.first.fuction.CeilingLight;
public class MainTest {
public static void main(String[] args) {
//测试遥控器的开关按钮
PrototypeControl prototypeControl = new PrototypeControl();
//将电器接口插入卡槽中
prototypeControl.setSlot1(new CeilingLight());
prototypeControl.setSlot2(new CeilingFan());
//按下按钮实现控制
prototypeControl.slot1On(false);
prototypeControl.slot2On(false);
prototypeControl.undo();
prototypeControl.undo();
}
}
Java
1
https://gitee.com/yan-jiadou/design-mode.git
git@gitee.com:yan-jiadou/design-mode.git
yan-jiadou
design-mode
Head first 设计模式学习
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891