摘要: 状态模式: 当一个对象的状态改变时,允许其行为也进行相应的变化。示例代码: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 阅读全文
posted @ 2011-10-07 19:50 Erebus_NET 阅读(132) 评论(0) 推荐(0) 编辑