00001 00027 #ifndef MSMAZES_CORE_FSM_INPUT_MAKER_YAW_HPP 00028 #define MSMAZES_CORE_FSM_INPUT_MAKER_YAW_HPP 00029 00030 #include <boost/mpl/bool.hpp> // boost::mpl::true_ and boost::mpl::false_ 00031 00032 namespace msmazes { 00033 00035 00062 struct FSMYawInputMaker 00063 { 00068 typedef boost::mpl::true_ 00069 RequiresSingleLayer; 00070 00075 typedef boost::mpl::true_ 00076 RequiresLastVisitedMap; 00077 00085 template < 00086 typename Pattern 00087 > 00088 inline static typename Pattern::OutDegree 00089 getInputCount( 00090 const Pattern& pattern 00091 ) 00092 { 00093 return pattern.getMaxOutDegree(); 00094 } 00095 00106 template < 00107 typename Pattern 00108 > 00109 static typename Pattern::DirectionChange 00110 getInput( 00111 const Pattern& pattern 00112 , const typename Pattern::CellIndex previous_cell_i 00113 , const typename Pattern::CellIndex current_cell_i 00114 , const typename Pattern::CellIndex next_cell_i 00115 ) 00116 { 00117 return 00118 (getInputCount(pattern) / 2) 00119 + pattern.getYawTurn(previous_cell_i, current_cell_i, next_cell_i); 00120 } 00121 }; 00122 } // namespace msmazes 00123 00124 #endif /* MSMAZES_CORE_FSM_INPUT_MAKER_YAW_HPP */
Multi-State Mazes in C++ is hosted by . Use the Table of Contents for navigation.