UNPKG

complex-engine

Version:

JS Component Entity Framework for Gamedevelopment

105 lines (78 loc) 2.47 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Source: Core.js</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Source: Core.js</h1> <section> <article> <pre class="prettyprint source linenums"><code>import Scene from './Scene'; /** * Complex Core. This class handles the rendering of the current scene. */ class Core { constructor() { /** @var {Scene | null} */ this.scene = null; /** @var {Core | null} */ this.instance = null; } /** * @returns {Core} */ static getInstance() { if (!Core.instance) { Core.instance = new Core(); } return Core.instance; } /** * load a scene to be rendered * @param {Scene} scene */ loadScene(scene) { this.scene = scene; this.scene.load(); this.scene.run(); } /** * render the loaded scene */ update() { if (this.scene) { this.scene.update(); } } /** * @returns {Scene | null} */ getScene() { return this.scene; } } export default Core; </code></pre> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Component.html">Component</a></li><li><a href="Core.html">Core</a></li><li><a href="Entity.html">Entity</a></li><li><a href="EntitySystem.html">EntitySystem</a></li><li><a href="GroupManager.html">GroupManager</a></li><li><a href="Manager.html">Manager</a></li><li><a href="Scene.html">Scene</a></li><li><a href="System.html">System</a></li><li><a href="VoidSystem.html">VoidSystem</a></li><li><a href="World.html">World</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Thu Sep 05 2019 21:13:34 GMT+0200 (Central European Summer Time) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>