diff --git a/doc/cfsm_statepattern.puml b/doc/cfsm_statepattern.puml index 17aa6b3..d4d7676 100644 --- a/doc/cfsm_statepattern.puml +++ b/doc/cfsm_statepattern.puml @@ -1,7 +1,9 @@ @startuml State Pattern +package "State Pattern" { + class Context { - -state + +state +operation() } @@ -17,9 +19,9 @@ class State2 { +operation() } -Context -r-> "1" State -State <|-- State1 -State <|-- State2 - +Context -- State +State <|-d- State1 +State <|-d- State2 +} @enduml \ No newline at end of file diff --git a/doc/mario_states.puml b/doc/mario_states.puml new file mode 100644 index 0000000..8648e97 --- /dev/null +++ b/doc/mario_states.puml @@ -0,0 +1,24 @@ +@startuml Mario State Machine + +state SmallMario +state SuperMario +state CapeMario +state FireMario +state DeadMario + +SmallMario --> CapeMario : Feather +SmallMario --> FireMario : FireFlower +SmallMario --> SuperMario : Mushroom + +SuperMario --> SmallMario : Monster +SuperMario ----> CapeMario : Feather +SuperMario -> FireMario : FireFlower + +CapeMario --> SmallMario : Monster + +FireMario --> SmallMario : Monster +FireMario --> CapeMario : Feather + +SmallMario --> SmallMario: Monster +SmallMario --> DeadMario : no more lifes +@enduml \ No newline at end of file