NintenJoe/zol — pull request #17 by NintenJoe (2014-03-29 05:09:31+00:00)
Title: Task 7.4

## Summary ##
Incorporating event queueing into the existing infrastructure was a lot more work than I had originally anticipated. Much of the extra work went into revamping the `State`, `StateMachine`, and `Entity` classes, and adding a `SimulationDelta` class to round out these changes. Making these changes as elegant as possible required making a few architectural changes, which are detailed below.

## Important Changes ##

### `SimulationDelta` Class ###
- Added this type and its associated tests.
- Incorporated this type into the existing architecture, which will allow for easier changes to be made in the future (should they be needed).

### `State` Class ###
- Added time out support for all states.
- Added a few helper functions to provide more information about state timers to outside classes.
- Added a full testing suite for the `State` type.
- Changed the return type of `State` simulation methods to a `SimulationDelta` (from a `PhysicalState`) to allow `State` instances to fire events on step, arrival, and departure.

### `StateMachine` Class ###
- Incorporated the `State` and `Transition` classes into the type.
- Adjusted the `StateMachine` constructor to intake a series of `State` and `Transition` instances instead of a full graph for better encapsulation.
- Added support to the `StateMachine` class for multi-state steps, which facilitates the 'intermediate state' behavior without requiring extra `State` implementation.
- Rewrote the testing suite for the `StateMachine` type to account for the changes.

### `Entity` Class ###
- Adjusted the interface of the `Entity` class to be a bit more descriptive about its underlying behavior.
- Added new helper functions to provide more information to outside classes.
- Added a full testing suite for the `Entity` type.