-
-
-
-
-
+ if (account) {
+ return (
+
-
- );
+
+
+ );
+ } else {
+ return
not ready
;
+ }
}
module.exports = addState(renderBody);
diff --git a/client/src/components/passive.container.jsx b/client/src/components/passive.container.jsx
new file mode 100755
index 00000000..5fb0da7e
--- /dev/null
+++ b/client/src/components/passive.container.jsx
@@ -0,0 +1,49 @@
+const preact = require('preact');
+const { connect } = require('preact-redux');
+const Phaser = require('phaser');
+const PhaserPassives = require('./phaser.passives');
+
+const addState = connect(
+ function receiveState(state) {
+ const {
+ game, activeSkill, activeIncoming, account,
+ } = state;
+ return {
+ game, activeSkill, activeIncoming, account,
+ };
+ }
+);
+
+class PhaserInstance extends preact.Component {
+ constructor(props) {
+ super(props);
+ this.props = props;
+ }
+
+ componentDidMount() {
+ // now mounted, can freely modify the DOM:
+ this.PhaserPassives = new PhaserPassives();
+ const config = {
+ type: Phaser.DOM.FILL,
+ width: 1200,
+ height: 900,
+ parent: 'passives',
+ physics: {
+ default: 'arcade',
+ arcade: {
+ gravity: { y: 0 },
+ },
+ },
+ scene: this.PhaserPassives,
+ };
+ const game = new Phaser.Game(config);
+ }
+
+ render() {
+ return (
+
+
+ );
+ }
+}
+module.exports = addState(PhaserInstance);
diff --git a/client/src/components/passive.node.js b/client/src/components/passive.node.js
new file mode 100755
index 00000000..042375ef
--- /dev/null
+++ b/client/src/components/passive.node.js
@@ -0,0 +1,36 @@
+const Phaser = require('phaser');
+
+class PassiveNode extends Phaser.GameObjects.Sprite {
+ constructor(scene, x, y, id, alloc) {
+ super(scene, x, y);
+ this.setTexture('eye');
+
+ this.scene = scene;
+ this.alloc = alloc;
+ this.id = id;
+ this.setPosition(x, y);
+ this.setScale(0.25);
+
+ if (this.alloc) {
+ this.setTint(0xff0000);
+ }
+ }
+
+ allocate() {
+ if (this.alloc) {
+ this.clearTint();
+ this.alloc = false;
+ } else {
+ this.alloc = true;
+ this.setTint(0xff0000);
+ }
+ for (let i = 0; i < this.scene.passiveNodes.length; i += 1) {
+ if (this.scene.passiveNodes[i].id === this.id) {
+ this.scene.passiveNodes[i].alloc = this.alloc;
+ }
+ }
+ this.scene.drawPassiveEdges();
+ }
+}
+
+module.exports = PassiveNode;