diff --git a/html-client/src/components/game.container.js b/html-client/src/components/game.container.js deleted file mode 100644 index 64149b37..00000000 --- a/html-client/src/components/game.container.js +++ /dev/null @@ -1,51 +0,0 @@ -const { connect } = require('preact-redux'); - -const actions = require('../actions'); - -const Game = require('./game.component'); - -const addState = connect( - function receiveState(state) { - const { ws, game, account, activeSkill, activeIncoming } = state; - - function selectSkillTarget(targetCrypId) { - if (activeSkill) { - return ws.sendGameSkill(game.id, activeSkill.crypId, targetCrypId, activeSkill.skill); - } - return false; - } - - // intercept self casting skills - if (activeSkill && activeSkill.skill.self_targeting) { - ws.sendGameSkill(game.id, activeSkill.crypId, null, activeSkill.skill.skill); - } - - function selectIncomingTarget(crypId) { - if (activeIncoming) { - return ws.sendGameTarget(game.id, crypId, activeIncoming); - } - return false; - } - - return { game, account, activeSkill, activeIncoming, selectSkillTarget, selectIncomingTarget }; - }, - - function receiveDispatch(dispatch) { - function setActiveSkill(crypId, skill) { - dispatch(actions.setActiveSkill(crypId, skill)); - } - - function setActiveIncoming(skillId) { - dispatch(actions.setActiveIncoming(skillId)); - } - - function quit() { - dispatch(actions.setGame(null)); - } - - return { setActiveSkill, setActiveIncoming, quit }; - } - -); - -module.exports = addState(Game); diff --git a/html-client/src/components/game.jsx b/html-client/src/components/game.jsx deleted file mode 100644 index 83a05744..00000000 --- a/html-client/src/components/game.jsx +++ /dev/null @@ -1,169 +0,0 @@ -const preact = require('preact'); -const key = require('keymaster'); -const range = require('lodash/range'); -const molecule = require('./molecule'); -const saw = require('./saw.component'); - -const SKILL_HOT_KEYS = ['Q', 'W', 'E', 'R']; - -function GamePanel(props) { - const { - game, - activeSkill, - activeIncoming, - setActiveSkill, - selectSkillTarget, - selectIncomingTarget, - account, - } = props; - - if (!game) return
{cryp.name}
-