Skip to content

Engine structure and behavior

Yxuer edited this page Aug 22, 2019 · 1 revision

The bulk of the CoLiNa-Engine engine (forgive the redundancy) is implemented in the GameManager class, which in turn has been implemented following the Singleton pattern. Basically, when the game start function is called GameManager::startGame(), the engine enters an infinite loop in which it does the following:

  1. Get an input command from the player. In this part, the GameManager::getCommand() method is called, which will receive the user input and check if it is correct (this is, it will discard too long or 1-word invalid commands).
  2. After the command has been read and verified, the GameManager::runCommand(input) method is called. This method will either execute the 1-word given command (usually custom, hardcoded behaviors), or it will execute the 2-word given command on the specified item, alerting the user if the item does not exist, if the area does not exist, etc.

For more information regarding the different classes and their interfaces, please check their respective Wiki articles:

Information regarding the Action class and how it can be extended is on the section about expanding the action set

Clone this wiki locally