UNPKG

complex-engine

Version:

JS Component Entity Framework for Gamedevelopment

95 lines (70 loc) 2.42 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Source: System.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: System.js</h1> <section> <article> <pre class="prettyprint source linenums"><code>import Entity from "./Entity"; import World from "./World"; /** * Abstract System. A System is responsible that your game works. It holds all the business logic and processes the * entities based on the data in the components */ class System { constructor() { /** @var {World | null} */ this.world = null; } /** * get notified when System is added to world * @abstract */ addedToWorld() { } /** * get notified when entity is added to world * @param {Entity} entity * @abstract */ added(entity) { } /** * get notified when entity is removed from world * @param {Entity} entity * @abstract */ removed(entity) { } /** * * @param {World} world */ setWorld(world) { this.world = world; } } export default System </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="Engine.html">Engine</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 Sun Sep 08 2019 20:40:30 GMT+0200 (Central European Summer Time) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>