summaryrefslogtreecommitdiff
path: root/frontend/src/actions/simulation/tick.js
blob: ca2027a4110d971b7e50810b86abba48c72048f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
export const GO_TO_TICK = 'GO_TO_TICK'
export const SET_LAST_SIMULATED_TICK = 'SET_LAST_SIMULATED_TICK'

export function incrementTick() {
    return (dispatch, getState) => {
        const { currentTick } = getState()
        dispatch(goToTick(currentTick + 1))
    }
}

export function goToTick(tick) {
    return (dispatch, getState) => {
        dispatch({
            type: GO_TO_TICK,
            tick,
        })
    }
}

export function setLastSimulatedTick(tick) {
    return {
        type: SET_LAST_SIMULATED_TICK,
        tick,
    }
}