Skip to content

Latest commit

 

History

History

state

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
状态模式

根据状态决定动作
1、把MMState抽象成一个抽象类,有三个方法:smile、cry、say

2、MMHappyState 继承 MMState,实现Happy时候的 smile、cry、say
   MMSadState 继承 MMState,实现Sad时候的 smile、cry、say
   
   thread利用线程的方式模拟有限状态机