react-game-engine
Advanced tools
Comparing version 0.2.1 to 0.3.0
@@ -169,3 +169,3 @@ module.exports = | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
@@ -183,9 +183,14 @@ | ||
exports.default = function (state, window) { | ||
return Object.keys(state).filter(function (key) { | ||
return state[key].renderer; | ||
}).map(function (key) { | ||
var entity = state[key]; | ||
if (_typeof(entity.renderer) === "object") return _react2.default.createElement(entity.renderer.type, _extends({ key: key }, entity, { window: window }));else if (typeof entity.renderer === "function") return _react2.default.createElement(entity.renderer, _extends({ key: key }, entity, { window: window })); | ||
}); | ||
exports.default = function (entities, window) { | ||
if (!entities || !window) return null; | ||
return Object.keys(entities).filter(function (key) { | ||
return entities[key].renderer; | ||
}).map(function (key) { | ||
var entity = entities[key]; | ||
if (_typeof(entity.renderer) === "object") return _react2.default.createElement(entity.renderer.type, _extends({ | ||
key: key, | ||
window: window | ||
}, entity));else if (typeof entity.renderer === "function") return _react2.default.createElement(entity.renderer, _extends({ key: key, window: window }, entity)); | ||
}); | ||
}; | ||
@@ -438,3 +443,3 @@ | ||
}, this.inputHandlers), | ||
this.state.entities ? this.props.renderer(this.state.entities, window) : null, | ||
this.props.renderer(this.state.entities, window), | ||
this.props.children | ||
@@ -441,0 +446,0 @@ ); |
{ | ||
"name": "react-game-engine", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "A lightweight game engine for React projects", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41857
524