This repository has been archived by the owner on Aug 27, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
218 additions
and
2,125 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* BOARD ACTIONS */ | ||
|
||
// Randomize board | ||
export const randomizeBoard = (height, width) => { | ||
return { | ||
type: "RANDOMIZE_BOARD", | ||
height, | ||
width | ||
}; | ||
}; | ||
|
||
// Increment the board by one step | ||
export const incrementBoard = boardData => { | ||
return { | ||
type: "INCREMENT_BOARD", | ||
boardData | ||
}; | ||
}; | ||
|
||
// Clear the board | ||
export const clearBoard = () => { | ||
return { | ||
type: "CLEAR_BOARD" | ||
}; | ||
}; | ||
|
||
// Load a preset board | ||
export const loadPreset = preset => { | ||
return { | ||
type: "LOAD_PRESET", | ||
preset | ||
}; | ||
}; | ||
|
||
/* GAME ACTIONS */ | ||
|
||
// Play the game | ||
export const playGame = speed => { | ||
return { | ||
type: "PLAY_GAME", | ||
speed | ||
}; | ||
}; | ||
|
||
// Pause the game | ||
export const pauseGame = () => { | ||
return { | ||
type: "PAUSE_GAME" | ||
}; | ||
}; | ||
|
||
/* CONFIG ACTIONS */ | ||
|
||
export const setSpeed = speed => { | ||
return { | ||
type: "SET_SPEED", | ||
speed | ||
}; | ||
}; | ||
|
||
// Resize the board | ||
export const setSize = (height, width) => { | ||
return { | ||
type: "SET_SIZE", | ||
height, | ||
width | ||
}; | ||
}; | ||
|
||
// Change the theme of the board | ||
export const setTheme = theme => { | ||
return { | ||
type: "SET_THEME", | ||
theme | ||
}; | ||
}; |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.