johnmccutchan/spectre — pull request #17 by donny-dont (2013-01-07 00:39:12+00:00)
Title: Cleanup

Moving values contained within BlendState to corresponding enumeration classes. If an invalid enumeration is passed to a setter an exception will throw.

Enumeration classes have the following static methods.

stringify - converts an enumeration to the corresponding string value (corresponds with Json.stringify)
parse - converts a string name to the corresponding enumeration (corresponds with Json.parse)
isValid - checks the validity of the integer enumeration
mappings - provides a map containing each string name and its corresponding integer value

The classes are not descended from a common enum class because static methods cannot be abstract.