From 3100e0533cb89a185ea021dfb83c4f364750180f Mon Sep 17 00:00:00 2001 From: Rubén Beltrán del Río Date: Tue, 29 May 2018 02:34:38 -0500 Subject: Add Naive Game Rules (#11) * Add components for tracking points * Add methods to create new entities * Adds nodes for points * Add system to detect points * Adds system to detect a winner * Add system to render points and winner * Add points required to win to config * Add it all to the engine * Add mention of points to changelog --- lib/components/winner.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lib/components/winner.js (limited to 'lib/components/winner.js') diff --git a/lib/components/winner.js b/lib/components/winner.js new file mode 100644 index 0000000..74de1c8 --- /dev/null +++ b/lib/components/winner.js @@ -0,0 +1,26 @@ +import { Component } from '@serpentity/serpentity'; + +/** + * Component that stores a winner + * + * @extends {external:Serpentity.Component} + * @class WinnerComponent + * @param {object} config a configuration object to extend. + */ +export default class WinnerComponent extends Component { + constructor(config) { + + super(config); + + /** + * The properthy that holds the winner + * + * @property {string} winner + * @instance + * @memberof WionnerComponent + */ + this.winner = this.winner || null; + } +}; + + -- cgit