Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/ShrimpCryptid/Secret-Hitler-Online
/ functions
Functions
258 in github.com/ShrimpCryptid/Secret-Hitler-Online
⨍
Functions
258
◇
Types & classes
59
↓ 1 callers
Method
assignRoles
Randomly assigns the player roles. @requires the number of players is between 5 and 10, inclusive. @modifies this @effects all Players in playerList
backend/src/main/java/game/SecretHitlerGame.java:305
↓ 1 callers
Method
checkIfGameOver
Updates the game state if the game ended by policies. @modifies this @effects sets this.state to the FASCIST_VICTORY_POLICY or LIBERAL_VICTO
backend/src/main/java/game/SecretHitlerGame.java:368
↓ 1 callers
Function
checkValidServiceWorker
(swUrl, config)
frontend/src/serviceWorker.js:101
↓ 1 callers
Method
convert
Creates a JSON object from a SecretHitlerGame that represents its state. @param game the SecretHitlerGame to convert. @throws NullPointerException if
backend/src/main/java/server/util/GameToJSONConverter.java:44
↓ 1 callers
Method
determineRolesToShow
* Updates which roles should be shown based on the role of the user. * @effects: if the user is {@code LIBERAL}, no roles will be shown. *
frontend/src/player/PlayerDisplay.js:58
↓ 1 callers
Method
fadeAndReplaceText
()
frontend/src/status-bar/StatusBar.js:21
↓ 1 callers
Method
fascistsCanWinByElection
()
backend/src/main/java/game/datastructures/board/Board.java:120
↓ 1 callers
Method
getAltText
* Gets the alt text for all images. * @return {String} {@code this.getNameWithYouTag}. * If this.props.showRole, appends a formatte
frontend/src/player/Player.js:117
↓ 1 callers
Method
getBusyPlayerSet
* Returns a set of players that should be considered 'busy' and marked on the interface. A player is considered * busy if the game is waiting for
frontend/src/player/PlayerDisplay.js:88
↓ 1 callers
Method
getConnections
Returns the set of websocket connections connected to this Lobby. @return a set of WsContexts, where each context is a user connected to the
backend/src/main/java/server/util/Lobby.java:91
↓ 1 callers
Method
getElectionTracker
()
backend/src/main/java/game/SecretHitlerGame.java:136
↓ 1 callers
Method
getHerokuAssignedPort
()
backend/src/main/java/server/SecretHitlerServer.java:96
↓ 1 callers
Method
getIcon
* Gets the relevant icon for the Player based on {@code this.props.role} * @return {image} the image source for either the liberal, fascist, or h
frontend/src/player/Player.js:41
↓ 1 callers
Method
getLastState
()
backend/src/main/java/game/SecretHitlerGame.java:100
↓ 1 callers
Method
getNumLiberalPolicies
()
backend/src/main/java/game/SecretHitlerGame.java:144
↓ 1 callers
Method
getRoleClass
* Changes the className based on the role (so that liberals can have blue text coloring). * @return {string} " liberal-text" if the role is LIBER
frontend/src/player/Player.js:66
↓ 1 callers
Method
getRoleImage
()
frontend/src/custom-alert/RoleAlert.js:53
↓ 1 callers
Method
getRoleImageAltText
()
frontend/src/custom-alert/RoleAlert.js:113
↓ 1 callers
Method
getTarget
()
backend/src/main/java/game/SecretHitlerGame.java:104
↓ 1 callers
Method
getUserCount
Returns the number of active users connected to the Lobby. @return the number of active websocket connections currently in the lobby.
backend/src/main/java/server/util/Lobby.java:280
↓ 1 callers
Method
getVotes
Returns a map representing what each player voted. @return a map, where the keys are the usernames and the booleans are the vote (yes/no) of
backend/src/main/java/game/SecretHitlerGame.java:537
↓ 1 callers
Method
getWeightedRandomIndex
(float[] weights)
backend/src/main/java/game/CpuPlayer.java:707
↓ 1 callers
Method
handleChancellorNomination
(SecretHitlerGame game)
backend/src/main/java/game/CpuPlayer.java:225
↓ 1 callers
Method
handleChancellorVoting
(SecretHitlerGame game)
backend/src/main/java/game/CpuPlayer.java:293
↓ 1 callers
Method
handleLegislativeChancellor
(SecretHitlerGame game)
backend/src/main/java/game/CpuPlayer.java:464
↓ 1 callers
Method
handleLegislativePresident
(SecretHitlerGame game)
backend/src/main/java/game/CpuPlayer.java:386
↓ 1 callers
Method
handlePostLegislative
(SecretHitlerGame game)
backend/src/main/java/game/CpuPlayer.java:613
↓ 1 callers
Method
handlePresidentVeto
(SecretHitlerGame game)
backend/src/main/java/game/CpuPlayer.java:515
↓ 1 callers
Method
handlePresidentialPowerElection
(SecretHitlerGame game)
backend/src/main/java/game/CpuPlayer.java:571
↓ 1 callers
Method
handlePresidentialPowerExecution
(SecretHitlerGame game)
backend/src/main/java/game/CpuPlayer.java:588
↓ 1 callers
Method
handlePresidentialPowerInvestigate
(SecretHitlerGame game)
backend/src/main/java/game/CpuPlayer.java:552
↓ 1 callers
Method
handlePresidentialPowerPeek
(SecretHitlerGame game)
backend/src/main/java/game/CpuPlayer.java:542
↓ 1 callers
Method
hasPlayerVoted
Returns whether the given player has voted yet during the currently open voting round.
backend/src/main/java/game/SecretHitlerGame.java:457
↓ 1 callers
Method
hasTimedOut
Returns whether the lobby has timed out. @return true if the Lobby has timed out.
backend/src/main/java/server/util/Lobby.java:81
↓ 1 callers
Function
if
(newState[PARAM_ELECTION_TRACKER] !== this.state.gameState[PARAM_ELECTION_TRACKER])
frontend/src/App.js:887
↓ 1 callers
Method
initializeDatabase
Initializes the database by adding the BACKUP table. @param c the connection to the database. @effects the Postgres SQL datbase has a new
backend/src/main/java/server/SecretHitlerServer.java:345
↓ 1 callers
Method
investigate
()
backend/src/main/java/game/datastructures/Player.java:69
↓ 1 callers
Method
isCpu
()
backend/src/main/java/game/datastructures/Player.java:55
↓ 1 callers
Method
isLiberalInDanger
(SecretHitlerGame game)
backend/src/main/java/game/CpuPlayer.java:190
↓ 1 callers
Method
kill
()
backend/src/main/java/game/datastructures/Player.java:63
↓ 1 callers
Method
loadDatabaseBackup
Loads lobby data stored in the database (intended to be run on server wake). @effects {@code codeToLobby} is set to the stored database
backend/src/main/java/server/SecretHitlerServer.java:243
↓ 1 callers
Method
makePlayers
(int numPlayers)
backend/src/test/java/game/testSecretHitlerGame.java:13
↓ 1 callers
Method
onClick
()
frontend/src/player/PlayerDisplay.js:182
↓ 1 callers
Method
onPlayerSelected
* Called when the player is selected. Calls this.props.onSelection if the player is a valid choice. * @param name the name of the player. *
frontend/src/player/PlayerDisplay.js:216
↓ 1 callers
Method
onWebSocketClose
Called when a websocket is closed. @param ctx the WsContext of the websocket. @modifies this @effects Removes the user from any connected lobbies.
backend/src/main/java/server/SecretHitlerServer.java:753
↓ 1 callers
Method
onWebSocketMessage
Parses a websocket message sent from the user. @param ctx the WsMessageContext of the websocket. @requires the context must have the following parame
backend/src/main/java/server/SecretHitlerServer.java:562
↓ 1 callers
Method
readObject
Called when an object is deserialized (see Serializable in Java docs). Initializes the userToUsername and activeUsernames, as they are transient objec
backend/src/main/java/server/util/Lobby.java:396
↓ 1 callers
Method
removeUser
Removes a user from the Lobby. @param context the websocket connection context of the player to remove. @throws IllegalArgumentException if {@code co
backend/src/main/java/server/util/Lobby.java:222
↓ 1 callers
Method
render
()
frontend/src/player/Player.js:136
↓ 1 callers
Method
resetDeck
Resets the Draw and Discard decks. @effects empties the discard deck, fills the draw deck with a standard card count, and shuffles.
backend/src/main/java/game/SecretHitlerGame.java:278
↓ 1 callers
Method
resetVoteAnimation
()
frontend/src/player/PlayerDisplay.js:253
↓ 1 callers
Method
setupVoteAnimation
* Creates the voting animation sequence.
frontend/src/player/PlayerDisplay.js:227
↓ 1 callers
Method
startLegislativeSession
Starts the legislative session. Sets the available policies and the game state.
backend/src/main/java/game/SecretHitlerGame.java:651
↓ 1 callers
Method
startNewGame
Starts a new SecretHitlerGame with the connected users as players. @throws RuntimeException if there are an insufficient number of players to
backend/src/main/java/server/util/Lobby.java:463
Method
Board
Constructs a new board. @modifies this @effects this is a new, empty board.
backend/src/main/java/game/datastructures/board/Board.java:26
Method
CpuPlayer
(String name)
backend/src/main/java/game/CpuPlayer.java:48
Function
DISABLE_EXECUTED_PLAYERS
(name, gameState)
frontend/src/player/PlayerDisplay.js:316
Function
DISABLE_INVESTIGATED_PLAYERS
(name, gameState)
frontend/src/player/PlayerDisplay.js:331
Function
DISABLE_NONE
()
frontend/src/player/PlayerDisplay.js:307
Function
DISABLE_TERM_LIMITED_PLAYERS
(name, gameState)
frontend/src/player/PlayerDisplay.js:349
Method
Deck
Constructs a new empty deck. @modifies this @effects this is a new deck with no Policies.
backend/src/main/java/game/datastructures/Deck.java:22
Function
HelmetMetaData
(props)
frontend/src/util/HelmetMetaData.js:4
Method
Lobby
Constructs a new Lobby.
backend/src/main/java/server/util/Lobby.java:55
Method
Player
Constructs a new Player with the given username. @param username The username of the player. @modifies this @effects this is a new Player that is aliv
backend/src/main/java/game/datastructures/Player.java:25
Method
Policy
(Type type)
backend/src/main/java/game/datastructures/Policy.java:15
Method
RemoveUserTask
(String username)
backend/src/main/java/server/util/Lobby.java:256
Method
SecretHitlerGame
Constructs a new game of Secret Hitler with the given players. @param players the names of the players to add to the game. @requires there can be no
backend/src/main/java/game/SecretHitlerGame.java:174
Function
charactersLeft
()
frontend/src/util/MaxLengthTextField.js:9
Method
checkLogin
Determines whether a login is valid. @param ctx the context of the login request. @requires the context must have the following parameters:
backend/src/main/java/server/SecretHitlerServer.java:394
Function
collapseSpaces
* Collapses whitespace characters (' ' and '\t') to single spaces. * @param text * @return the text, but any repeating sequences of '\t' or
frontend/src/util/MaxLengthTextField.js:44
Method
compareTo
(CpuPlayer o)
backend/src/main/java/game/CpuPlayer.java:730
Method
componentDidMount
()
frontend/src/custom-alert/PolicyEnactedAlert.js:26
Function
componentDidUpdate
(prevProps, prevState, snapshot)
frontend/src/board/Deck.js:40
Method
componentDidUpdate
(prevProps, prevState, snapshot)
frontend/src/status-bar/StatusBar.js:14
Function
componentWillUnmount
()
frontend/src/custom-alert/IconSelection.js:41
Function
componentWillUnmount
()
frontend/src/custom-alert/VotingPrompt.js:83
Method
componentWillUnmount
()
frontend/src/custom-alert/PolicyEnactedAlert.js:32
Method
componentWillUnmount
()
frontend/src/custom-alert/SelectPlayerPrompt.js:43
Method
componentWillUnmount
()
frontend/src/custom-alert/PeekPrompt.js:33
Function
constructor
(props)
frontend/src/App.js:176
Function
constructor
(props)
frontend/src/board/Deck.js:20
Function
constructor
(props)
frontend/src/custom-alert/IconSelection.js:20
Function
constructor
(props)
frontend/src/custom-alert/VetoPrompt.js:8
Function
constructor
(props)
frontend/src/custom-alert/VotingPrompt.js:29
Function
constructor
(props)
frontend/src/custom-alert/ElectionTrackerAlert.js:12
Function
constructor
(props)
frontend/src/custom-alert/CustomAlert.js:6
Function
constructor
(props)
frontend/src/event-bar/EventBar.js:6
Method
constructor
(props)
frontend/src/player/PlayerDisplay.js:42
Method
constructor
(props)
frontend/src/player/Player.js:29
Method
constructor
(props)
frontend/src/custom-alert/PolicyEnactedAlert.js:19
Method
constructor
(props)
frontend/src/custom-alert/PlayerDisplayPrompt.js:12
Method
constructor
(props)
frontend/src/custom-alert/SelectPlayerPrompt.js:24
Method
constructor
(props)
frontend/src/custom-alert/ButtonPrompt.js:9
Method
constructor
(props)
frontend/src/custom-alert/PresidentLegislativePrompt.js:15
Method
constructor
(props)
frontend/src/custom-alert/InvestigationAlert.js:18
Method
constructor
(props)
frontend/src/custom-alert/ChancellorLegislativePrompt.js:15
Method
constructor
(props)
frontend/src/custom-alert/PeekPrompt.js:14
Method
constructor
(props)
frontend/src/status-bar/StatusBar.js:5
Method
createNewLobby
Generates a new lobby and returns the access code. @param ctx the HTTP get request context.
backend/src/main/java/server/SecretHitlerServer.java:435
Method
getActivatedPower
()
backend/src/main/java/game/datastructures/board/FiveToSixPlayerBoard.java:11
← previous
next →
101–200 of 258, ranked by callers