摘要:
状态模式: 当一个对象的状态改变时,允许其行为也进行相应的变化。示例代码:using System;usingSystem.Text;usingSystem.IO;usingSystem.Collections.Generic;namespace Hello{ //GumballMachine class public class GumballMachine { State soldOutState; State noQuarterState; State hasQuarterState; State soldState; State state; int count = 0; public 阅读全文