Loading [MathJax]/extensions/tex2jax.js
A reimplementation of Mario Kart Wii's physics engine in C++
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages Concepts
SceneCreatorDynamic.cc
1#include "SceneCreatorDynamic.hh"
2
3#include <game/scene/RaceScene.hh>
4#include <game/scene/RootScene.hh>
5
6namespace Host {
7
8EGG::Scene *SceneCreatorDynamic::create(int sceneId) const {
9 return create(static_cast<SceneId>(sceneId));
10}
11
12void SceneCreatorDynamic::destroy(int sceneId) const {
13 destroy(static_cast<SceneId>(sceneId));
14}
15
17EGG::Scene *SceneCreatorDynamic::create(SceneId sceneId) const {
18 switch (sceneId) {
19 case SceneId::Root:
20 return new Scene::RootScene;
21 case SceneId::Race:
22 return new Scene::RaceScene;
23 default:
24 PANIC("Unreachable scene creation!");
25 }
26}
27
29void SceneCreatorDynamic::destroy(SceneId sceneId) const {
30 switch (sceneId) {
31 case SceneId::Root:
32 case SceneId::Race:
33 // The base game doesn't do anything, so we don't either
34 break;
35 default:
36 PANIC("Unreachable scene deletion!");
37 }
38}
39
40} // namespace Host
Base class for all scenes.
Definition Scene.hh:16
Represents an instance of a race.
Definition RaceScene.hh:8
The parent scene for all other scenes.
Definition RootScene.hh:9
Represents the host application.
Definition Option.cc:5