1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00
chess/assets/js/store/actions.js
Dan Barber c0facfa4d5
Players take turns
Restricts players to only be able to move their own pieces and only when
it's their turn.
2018-02-24 15:52:22 -05:00

34 lines
542 B
JavaScript

const SET_GAME = "SET_GAME";
const SET_GAME_ID = "SET_GAME_ID";
const SELECT_PIECE = "SELECT_PIECE";
export const setGame = (data) => {
return {
type: SET_GAME,
board: data.board,
player: data.player,
turn: data.turn
}
}
export const setPlayer = (player) => {
return {
type: SET_PLAYER,
player: player
}
}
export const setGameId = (gameId) => {
return {
type: SET_GAME_ID,
gameId: gameId
}
}
export const selectPiece = (coords) => {
return {
type: SELECT_PIECE,
coords: coords
};
}