Using sqlite database, mt proctor animation.
This commit is contained in:
@@ -17,4 +17,7 @@
|
||||
// <https://www.gnu.org/licenses/>.
|
||||
|
||||
export const SET_START_GAMES = 'set-start-games';
|
||||
export const SET_OPEN_GAMES = 'set-open-games';
|
||||
export const SET_USER = 'set-user';
|
||||
export const SET_ERRORS = 'set-errors';
|
||||
export const START_OR_JOIN_GAME = 'start-or-join-game';
|
||||
|
||||
@@ -16,16 +16,32 @@
|
||||
// along with the Alpha Centauri Farming project. If not, see
|
||||
// <https://www.gnu.org/licenses/>.
|
||||
|
||||
import { SET_START_GAMES, START_OR_JOIN_GAME } from './actionTypes.js'
|
||||
import { SET_START_GAMES, START_OR_JOIN_GAME, SET_USER, SET_OPEN_GAMES,
|
||||
SET_ERRORS } from './actionTypes.js'
|
||||
|
||||
export { setStartGames, startOrJoinGame }
|
||||
export { setStartGames, startOrJoinGame, setUser, setOpenGames, setErrors }
|
||||
|
||||
function setStartGames(games) {
|
||||
return { type: SET_START_GAMES,
|
||||
games };
|
||||
}
|
||||
|
||||
function setOpenGames(games) {
|
||||
return { type: SET_OPEN_GAMES,
|
||||
games };
|
||||
}
|
||||
|
||||
function setUser(user) {
|
||||
return { type: SET_USER,
|
||||
user };
|
||||
}
|
||||
|
||||
function startOrJoinGame(msg) {
|
||||
return { type: START_OR_JOIN_GAME,
|
||||
msg };
|
||||
}
|
||||
|
||||
function setErrors(errors) {
|
||||
return { type: SET_ERRORS,
|
||||
errors };
|
||||
}
|
||||
|
||||
@@ -16,11 +16,15 @@
|
||||
// along with the Alpha Centauri Farming project. If not, see
|
||||
// <https://www.gnu.org/licenses/>.
|
||||
|
||||
import { SET_START_GAMES, START_OR_JOIN_GAME } from './actionTypes.js'
|
||||
import { SET_START_GAMES, START_OR_JOIN_GAME, SET_USER, SET_OPEN_GAMES,
|
||||
SET_ERRORS } from './actionTypes.js'
|
||||
import { SCREENS } from '../../constants.js'
|
||||
|
||||
const initialState = {
|
||||
start: { games: [] },
|
||||
start: { games: [],
|
||||
openGames: [],
|
||||
errors: [],
|
||||
user: false },
|
||||
msg: null
|
||||
};
|
||||
|
||||
@@ -28,6 +32,12 @@ export default function(state = initialState, action) {
|
||||
switch (action.type) {
|
||||
case SET_START_GAMES:
|
||||
return { ...state, start: { ...state.start, games: action.games }};
|
||||
case SET_OPEN_GAMES:
|
||||
return { ...state, start: { ...state.start, openGames: action.games }};
|
||||
case SET_USER:
|
||||
return { ...state, start: { ...state.start, user: action.user }};
|
||||
case SET_ERRORS:
|
||||
return { ...state, start: { ...state.start, errors: action.errors }};
|
||||
case START_OR_JOIN_GAME:
|
||||
return { ...state, msg: action.msg };
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user