- 博客(2)
- 收藏
- 关注
原创 状态模式
设计模式——状态模式 适用场景: 1.可以用于控制游戏加载不用的场景 public class GameLoop : MonoBehaviour { public SceneStateController controller =null; private void Awake() { DontDestroyOnLoad(this.gameObject); } // Start is called before the first fr
2021-01-11 13:21:46
80
原创 Head First 设计模式——策略模式(C#)
设计模式——策略模式 设计原则 1.封装变化 2.针对接口编程,而不是针对实现编程 3.多用组合,少用继承 使用策略模式写的代码 class Program { static void Main(string[] args) { Duck realDuck = new RealDuck(); realDuck.Display();//父类中放的子类,但是如果方法重写,调用的是子类的方法 .
2021-01-02 21:31:36
399
2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人