Interfaces
In Gosu, an interface defines a strict contract of interaction and expectation between two or more software elements. Conceptually, you can think of an interface as a list of method signatures grouped together. In practice, the interface provides a group of related method signatures that typically have empty bodies. The interface requires other code to implement those empty methods.
From a syntax perspective, an interface looks like a class definition. However, the interface is a specification of a set of required functions for any class that implements the interface. Thus, an interface requires that the implementing class provides the code in the set of interface methods.
If a class implements the interface, the class agrees to implement all these methods with the appropriate method signatures. The code implementing the interface agrees that each method appropriately performs the required task if external code calls those methods.
Gosu classes can implement interfaces defined in either Gosu or Java.
