shoo / cushion

A library to help state transition matrix disign
Boost Software License 1.0
6 stars 0 forks source link

Fix issue #4 - Support of nested state transitions #9

Closed shoo closed 5 years ago

shoo commented 5 years ago

This pull request introduces a solution to issue #4 by using a state pattern.

Although this pull request only introduces the state pattern, the nested state transition is realized by each state having a STM.

Note: This implementation has some problems. Each method of the class that inherits State must always transfer processing to the upper class as super.foo(). This way is very ugly. However, in order to solve this, I have to prepare a mechanism such as MemberFunctionGenerator myself. If it does so, it will fall into more serious black magic. Also, this way of potentially using class inheritance is incompatible with -betterC. This solution will be an obstacle if support -betterC in the future.

shoo commented 5 years ago

Apparently ldc-1.15.0 32bit compilation on MacOSX seems to be broken.