1. Business Rules

Often in games or simulations, business rules are added incrementally as the application evolves.

The Orders class enables you to register discrete snippets of code which you can call up in the order they are defined in the class declaration.

This allows you to chain up callable rules without having to explicitly invoke them one after the other.

Nothing is done behind your back. It’s just that if you create a subclass of Orders, whichever methods you register will be lined up sequentially for you to call them in the order you wrote them.

class turberfield.utils.orders.Orders(**kwargs)
classmethod register()

Use this decorator to register a function for ordered execution.

methods

Return a sequence of 2-tuples; (name, method).

This property gives you all the object’s registered methods in the order they were defined.