*/
private $shortName = "";
+ /**
+ * The name of the master template
+ */
+ private $masterTemplate = "shipsimu_main";
+
/**
* An instance of this class
*/
/**
* Getter for the version number
*
- * @return $appVersion The application's version number
+ * @return $appVersion The application's version number
*/
public final function getAppVersion () {
return $this->appVersion;
/**
* Setter for the version number
*
- * @param $appVersion The application's version number
+ * @param $appVersion The application's version number
* @return void
*/
public final function setAppVersion ($appVersion) {
$this->shortName = $shortName;
}
+ /**
+ * Getter for master template name
+ *
+ * @return $masterTemplate Name of the master template
+ */
+ public final function getMasterTemplate () {
+ return $this->masterTemplate;
+ }
+
/**
* Launches the ship-simulator game
*
* @return void
*/
public final function entryPoint () {
- // Handle the request
- $this->handleRequest();
+ // Get default command
+ $defaultCommand = $this->getConfigInstance()->readConfig("default_command");
- // Prepare the template engine
- $tplEngine = $this->prepareTemplateEngine($this);
+ // Create a new request object
+ $requestInstance = HttpRequest::createHttpRequest();
- // Load the main template
- $tplEngine->loadCodeTemplate("shipsimu_main");
+ // ... and a new response object
+ $responseInstance = HttpResponse::createHttpResponse($this);
- // Raise an error here
- trigger_error(__METHOD__.": Unfinished work!");
+ // Get a new controller instance as well
+ $controllerInstance = LocalControllerResolver::createLocalControllerResolver($defaultCommand, $this)->resolveDefaultController();
+
+ // Handle the request
+ $controllerInstance->handleRequest($requestInstance, $responseInstance);
}
}