See the mentioned game engine reference which closely parallels this.