rename ability to skill

This commit is contained in:
ntr
2018-10-21 12:05:07 +11:00
parent 3a4c9e4971
commit c3d20e888b
7 changed files with 85 additions and 83 deletions
+5 -5
View File
@@ -5,15 +5,15 @@ const Game = require('./game');
const addState = connect(
function receiveState(state) {
const { ws, game, account } = state;
function sendGameAbility(crypId, targetTeamId, ability) {
return ws.sendGameAbility(game.id, crypId, targetTeamId, ability);
function sendGameSkill(crypId, targetTeamId, skill) {
return ws.sendGameSkill(game.id, crypId, targetTeamId, skill);
}
function sendGameTarget(crypId, abilityId) {
return ws.sendGameTarget(game.id, crypId, abilityId);
function sendGameTarget(crypId, skillId) {
return ws.sendGameTarget(game.id, crypId, skillId);
}
return { game, account, sendGameAbility, sendGameTarget };
return { game, account, sendGameSkill, sendGameTarget };
}
);
+2 -2
View File
@@ -1,6 +1,6 @@
const preact = require('preact');
function GamePanel({ game, sendGameAbility, sendGameTarget, account }) {
function GamePanel({ game, sendGameSkill, sendGameTarget, account }) {
if (!game) return <div>...</div>;
const otherTeams = game.teams.filter(t => t.id !== account.id);
@@ -23,7 +23,7 @@ function GamePanel({ game, sendGameAbility, sendGameTarget, account }) {
<button
className="button is-dark is-fullwidth"
type="submit"
onClick={() => sendGameAbility(c.id, otherTeams[0].id, 'Attack')}>
onClick={() => sendGameSkill(c.id, otherTeams[0].id, 'Attack')}>
Attack
</button>
</div>