msmazes::FSMDirectionInputMaker Struct Reference
[Core FSM Layer]

#include <msmazes/core/fsm/input/maker_direction.hpp>

List of all members.


Detailed Description

This FSM Input Maker builds inputs according to the edge direction between two cells in a Pattern. The edge direction type must be convertible to the input index type of a finite state machine; otherwise, this struct cannot be used.

The walkthrough arrow maze portion of the program that comes with the binary distribution was compiled using this struct, because it results in the most natural user interface: up goes north, right goes east, down goes south, left goes west, and so on. Note that the direction of the input is relative to the underlying physical pattern; if you want to input directions relative to the user, you need FSMYawInputMaker.


Model of



Public Types

typedef boost::mpl::false_ RequiresSingleLayer
typedef boost::mpl::false_ RequiresLastVisitedMap

Static Public Member Functions

template<typename Pattern>
Pattern::Direction getInputCount (const Pattern &pattern)
template<typename Pattern>
Pattern::Direction getInput (const Pattern &pattern, const typename Pattern::CellIndex previous_cell_i, const typename Pattern::CellIndex current_cell_i, const typename Pattern::CellIndex next_cell_i)


Member Typedef Documentation

typedef boost::mpl::false_ msmazes::FSMDirectionInputMaker::RequiresSingleLayer
 

This FSM Input Maker does not require a single layer.

typedef boost::mpl::false_ msmazes::FSMDirectionInputMaker::RequiresLastVisitedMap
 

This FSM Input Maker does not require a last-visited map.


Member Function Documentation

template<typename Pattern>
Pattern::Direction msmazes::FSMDirectionInputMaker::getInputCount const Pattern &  pattern  )  [inline, static]
 

Calculates the number of possible inputs that the finite state machine can process, as defined in the FSM Input Maker concept. Returns the maximum number of edges from any source vertex in the specified pattern's underlying graph.

template<typename Pattern>
Pattern::Direction msmazes::FSMDirectionInputMaker::getInput const Pattern &  pattern,
const typename Pattern::CellIndex  previous_cell_i,
const typename Pattern::CellIndex  current_cell_i,
const typename Pattern::CellIndex  next_cell_i
[inline, static]
 

Calculates the input required for the finite state machine to change state from pointing to the cell at index current_cell_i to pointing to the cell at index next_cell_i, as defined in the FSM Input Maker concept. The previous_cell_i parameter is ignored. Returns a representation of the course or bearing that is followed when traversing the corresponding edge in the specified pattern's underlying graph.


Multi-State Mazes in C++ is hosted by SourceForge.net. Use the Table of Contents for navigation.