MCPcopy Index your code

hub / github.com/ShrimpCryptid/Secret-Hitler-Online / functions

Functions258 in github.com/ShrimpCryptid/Secret-Hitler-Online

↓ 24 callersMethodadd
Adds the given Policy to the top of the deck. @param newPolicy the Policy to add to the deck. @modifies this @effects adds the given Policy to the dec
backend/src/main/java/game/datastructures/Deck.java:46
↓ 22 callersMethodgetState
Gets the current state of the game.SecretHitlerGame. @return a game.GameState representing the current state of the game.
backend/src/main/java/game/SecretHitlerGame.java:345
↓ 18 callersMethodgetUsername
()
backend/src/main/java/game/datastructures/Player.java:32
↓ 17 callersMethodgetPlayerList
Gets the list of active players. @return a copy of the list of Players.
backend/src/main/java/game/SecretHitlerGame.java:243
↓ 16 callersMethodremove
Removes the Policy from the top of the deck. @throws IndexOutOfBoundsException if the deck is empty. @modifies this @effects removes the Policy from t
backend/src/main/java/game/datastructures/Deck.java:33
↓ 15 callersMethodchooseRandomPlayerWeighted
Returns the name of a player, chosen by weighted random. Weighting is determined by suspected or known roles, and can be biased towards or away from u
backend/src/main/java/game/CpuPlayer.java:645
↓ 15 callersMethodgetCurrentPresident
()
backend/src/main/java/game/SecretHitlerGame.java:108
↓ 15 callersMethodgetIdentity
()
backend/src/main/java/game/datastructures/Player.java:47
↓ 14 callersMethodgetType
()
backend/src/main/java/game/datastructures/Policy.java:19
↓ 14 callersMethodisAlive
()
backend/src/main/java/game/datastructures/Player.java:67
↓ 13 callersMethodgame
Returns the current game. @throws RuntimeException if called when there is no active game ({@code !this.isInGame()}). @retur
backend/src/main/java/server/util/Lobby.java:517
↓ 12 callersMethodgetPlayer
(String username)
backend/src/main/java/game/SecretHitlerGame.java:263
↓ 10 callersMethodtryGetIndexOfPolicy
Gets the index of the first policy of a matching type, if it exists. Returns -1 otherwise.
backend/src/main/java/game/CpuPlayer.java:376
↓ 9 callersMethodgetNumFascistPolicies
Gets the count of fascist policies. @return the number of fascist policies enacted.
backend/src/main/java/game/datastructures/board/Board.java:69
↓ 8 callersMethodgetCurrentChancellor
()
backend/src/main/java/game/SecretHitlerGame.java:112
↓ 8 callersMethodinitialize
(SecretHitlerGame game)
backend/src/main/java/game/CpuPlayer.java:55
↓ 8 callersMethodverifyIsPresident
Verifies that the user is the president. @param name String name of the user. @param lobby the Lobby that the game is in. @throws RuntimeException i
backend/src/main/java/server/SecretHitlerServer.java:727
↓ 7 callersMethodgetSize
Gets the number of Policy cards @return the size of the deck.
backend/src/main/java/game/datastructures/Deck.java:68
↓ 6 callersMethodchancellorEnactPolicy
Enacts the Policy in the list of chancellor policy options. @param index the index of the policy in the list of legislative choices to e
backend/src/main/java/game/SecretHitlerGame.java:749
↓ 6 callersMethodisEmpty
()
backend/src/main/java/game/datastructures/Deck.java:60
↓ 6 callersMethodisInGame
Returns whether the Lobby is currently in a game. @return true iff the Lobby has a currently active game.
backend/src/main/java/server/util/Lobby.java:445
↓ 6 callersMethodmakePlayers
(int numPlayers)
backend/src/test/java/game/testCpuPlayer.java:23
↓ 6 callersMethodupdateReputation
(String name, int repModifier)
backend/src/main/java/game/CpuPlayer.java:99
↓ 5 callersMethodconcludePresidentialActions
Called when the president's actions are over. @modifies this @effects advances the state to {@code POST_LEGISLATIVE}.
backend/src/main/java/game/SecretHitlerGame.java:577
↓ 5 callersMethodgetPlayerOfIdentity
(SecretHitlerGame game, Identity id)
backend/src/test/java/game/testCpuPlayer.java:31
↓ 5 callersMethodhasPlayer
Checks if the game has a player with the given username. @param username the String username of the player to search for. @return true iff the player
backend/src/main/java/game/SecretHitlerGame.java:226
↓ 5 callersMethodisFascist
@return true if the player is fascist or hitler.
backend/src/main/java/game/datastructures/Player.java:76
↓ 5 callersMethodisFascistInDanger
(SecretHitlerGame game)
backend/src/main/java/game/CpuPlayer.java:186
↓ 5 callersMethodupdateAllUsers
Sends a message to every connected user with the current game state. @effects a message containing a JSONObject representing the state of the
backend/src/main/java/server/util/Lobby.java:293
↓ 4 callersMethodact
Allows CpuPlayers to take an action, potentially updating the game state. @return Returns true if the CPU took an action that updated the game state.
backend/src/main/java/game/CpuPlayer.java:152
↓ 4 callersMethodcanHitlerWinByElection
(SecretHitlerGame game)
backend/src/main/java/game/CpuPlayer.java:194
↓ 4 callersMethodgetClassName
* Darkens the text, images, and background if disabled and highlights the player. * @return {String} If {@code this.props.disabled} is true, the
frontend/src/player/Player.js:80
↓ 4 callersMethodgetIndexWithDefault
* Gets the value at an index of an array, defaulting if the value is too large or small. * @param array the array to get data from. * @param
frontend/src/custom-alert/RoleAlert.js:79
↓ 4 callersMethodgetPlayerOrder
* Returns an array representing the player order. Removes the player if this.props.includeUser is false.
frontend/src/player/PlayerDisplay.js:127
↓ 4 callersMethodhasUser
Returns whether the given user (websocket connection) is in this lobby @param context the Websocket context of a user. @return true iff the {@code co
backend/src/main/java/server/util/Lobby.java:104
↓ 4 callersMethodisHitler
()
backend/src/main/java/game/datastructures/Player.java:59
↓ 4 callersMethodpresidentialVeto
Handles the president's response to an initiated veto. @param response is the president's vote (true = veto accepted, false = veto de
backend/src/main/java/game/SecretHitlerGame.java:803
↓ 4 callersMethodremoveDeadPlayersAndSelf
(List<Player> playerList)
backend/src/main/java/game/CpuPlayer.java:213
↓ 4 callersMethodshuffle
Shuffles the deck. @effects Randomizes the ordering of the policy cards in this Deck.
backend/src/main/java/game/datastructures/Deck.java:76
↓ 4 callersMethodvoteWithProbability
(SecretHitlerGame game, float yesProbability)
backend/src/main/java/game/CpuPlayer.java:271
↓ 3 callersMethodcanAddUserDuringGame
Checks if a user can be added back to the lobby while a game is running. @param name the name of the user to add. @return true if the user can be add
backend/src/main/java/server/util/Lobby.java:139
↓ 3 callersMethodchancellorVeto
Marks the chancellor as having vetoed the current policy agenda. @throws IllegalStateException if called when the state is not
backend/src/main/java/game/SecretHitlerGame.java:772
↓ 3 callersMethodconvertPolicyListToStringArray
Converts a list of policies into a string array. @param list the list of policies. @return a string array with the same length as the list, where each
backend/src/main/java/server/util/GameToJSONConverter.java:108
↓ 3 callersMethoddidElectionTrackerAdvance
()
backend/src/main/java/game/SecretHitlerGame.java:148
↓ 3 callersMethoddidVetoOccurThisTurn
()
backend/src/main/java/game/SecretHitlerGame.java:152
↓ 3 callersMethodgetChancellorLegislativeChoices
Gets the legislative choices available for the Chancellor. @throws IllegalStateException if called when the state is not
backend/src/main/java/game/SecretHitlerGame.java:721
↓ 3 callersMethodgetDrawSize
()
backend/src/main/java/game/SecretHitlerGame.java:128
↓ 3 callersMethodgetLastEnactedType
Gets the type of the last enacted policy. @throws NullPointerException if no policy has been enacted yet. @return the Policy.Type of the last policy e
backend/src/main/java/game/datastructures/board/Board.java:57
↓ 3 callersMethodgetNumFascistPolicies
()
backend/src/main/java/game/SecretHitlerGame.java:140
↓ 3 callersMethodgetNumLiberalPolicies
Gets the count of liberal policies. @return the number of liberal policies enacted.
backend/src/main/java/game/datastructures/board/Board.java:78
↓ 3 callersMethodgetPlayerHTML
* Gets the HTML tags for the players in the provided indices. * @param start {int} the starting index, inclusive. * @param end {int} the end
frontend/src/player/PlayerDisplay.js:149
↓ 3 callersMethodhasBeenInvestigated
()
backend/src/main/java/game/datastructures/Player.java:71
↓ 3 callersMethodhasUserWithName
Returns true if the lobby has a user with a given username. @param name the username to check the Lobby for. @return true iff the username {@code nam
backend/src/main/java/server/util/Lobby.java:126
↓ 3 callersMethodindexOfPlayer
Gets the index of a player in the list. @param username the username to search for. @return the index of the given player in the list. Returns -1 if
backend/src/main/java/game/SecretHitlerGame.java:254
↓ 3 callersMethodisFull
Checks whether the lobby is full. @return Returns true if the number of players in the lobby is {@literal >= } {@code SecretHitlerGame.MAX_PL
backend/src/main/java/server/util/Lobby.java:150
↓ 3 callersMethodnominateChancellor
Selects the chancellor for the current legislation. @param username username of the chancellor to elect. @throws IllegalStateException if the stat
backend/src/main/java/game/SecretHitlerGame.java:431
↓ 3 callersMethodpeek
Peeks at a Policy in the deck. @param index the index of the Policy in the deck, where {@code index} = 0 is the top of the deck. @throws IndexOutOfBou
backend/src/main/java/game/datastructures/Deck.java:56
↓ 3 callersMethodremoveInactiveLobbies
Checks for and removes any lobbies that have timed out. @effects For each lobby in the {@code codeToLobby} map, checks if the lobby has time
backend/src/main/java/server/SecretHitlerServer.java:173
↓ 3 callersMethodsetIdentity
Sets the player's identity. @param id the Identity of the player. @throws IllegalArgumentException if {@code id} is null @modifies this @effects sets
backend/src/main/java/game/datastructures/Player.java:43
↓ 3 callersMethodshuffleDiscardIntoDraw
Adds the discard deck to the draw deck and shuffles. @modifies this @effects Empties the discard pile into the draw pile and shuffles.
backend/src/main/java/game/SecretHitlerGame.java:394
↓ 3 callersMethodtrySetUserIcon
Attempts to set the player's icon to the given iconID and returns whether it was set. @param iconID the ID of the new icon to give the player. @param
backend/src/main/java/server/util/Lobby.java:415
↓ 2 callersMethodadvanceElectionTracker
Advances the election tracker and enacts a policy if needed. @modifies this @effects If the tracker < 2, advances the tracker by 1. If the t
backend/src/main/java/game/SecretHitlerGame.java:549
↓ 2 callersMethodcapitalizeFirstOnly
* Capitalizes only the first character of the given text. * @param {String} text the text to capitalize. * @return {String} text where only
frontend/src/player/Player.js:58
↓ 2 callersMethodelectNextPresident
Sets the next president through the Election power. @param username the username of the player to become president next. @throws IllegalStateExceptio
backend/src/main/java/game/SecretHitlerGame.java:992
↓ 2 callersMethodenactPolicy
Enacts the given policy. @param policy the Policy to enact. @throws IllegalStateException if the liberals or fascists have already won.
backend/src/main/java/game/datastructures/board/Board.java:39
↓ 2 callersMethodendPeek
Ends the {@code PRESIDENTIAL_POWER_PEEK} state. @throws IllegalStateException if called when state is not {@code PRESID
backend/src/main/java/game/SecretHitlerGame.java:902
↓ 2 callersMethodendPresidentialTerm
Called to end the current's president term. @throws IllegalStateException if the state is not {@code POST_LEGISLATIVE}. @modifies this @effects advan
backend/src/main/java/game/SecretHitlerGame.java:596
↓ 2 callersMethodexecutePlayer
Executes a given player. @param username the username of the player to execute. @throws IllegalStateException if called when state is not
backend/src/main/java/game/SecretHitlerGame.java:956
↓ 2 callersMethodgenerateCode
Generates a random code. @return a String code, with length specified by {@code this.CODE_LENGTH} and characters randomly chosen from
backend/src/main/java/server/SecretHitlerServer.java:460
↓ 2 callersMethodgetActivatedPower
Gets the presidential power (if any) that was activated by the last policy. @requires a policy has already been enacted. @return If no presidential po
backend/src/main/java/game/datastructures/board/Board.java:116
↓ 2 callersMethodgetClass
()
frontend/src/status-bar/StatusBar.js:30
↓ 2 callersMethodgetDatabaseConnection
Attempts to get a connection to the PostGres database. @return null if no connection could be made. otherwise, returns a {@code java.sql.Conn
backend/src/main/java/server/SecretHitlerServer.java:207
↓ 2 callersMethodgetDiscardSize
()
backend/src/main/java/game/SecretHitlerGame.java:132
↓ 2 callersMethodgetLastChancellor
()
backend/src/main/java/game/SecretHitlerGame.java:120
↓ 2 callersMethodgetLastEnactedPolicy
()
backend/src/main/java/game/SecretHitlerGame.java:124
↓ 2 callersMethodgetLastPresident
()
backend/src/main/java/game/SecretHitlerGame.java:116
↓ 2 callersMethodgetLivingPlayerCount
()
backend/src/main/java/game/SecretHitlerGame.java:406
↓ 2 callersMethodgetNameWithYouTag
* Returns the name of the player, with an optional " (you)" tag if {@code this.props.isUser.}
frontend/src/player/Player.js:128
↓ 2 callersMethodgetNextActivePlayer
Finds the next active, living player in order. @param player the player to find the next active player from. @return the username of the next player
backend/src/main/java/game/SecretHitlerGame.java:632
↓ 2 callersMethodgetPeek
Gets the preview of the top 3 cards of the deck during the {@code PRESIDENTIAL_POWER_PEEK} state. @throws IllegalStateException if called when state
backend/src/main/java/game/SecretHitlerGame.java:882
↓ 2 callersMethodgetPlayerReputationWithIdentity
Gets the player reputation, setting to min/max value if identity is known.
backend/src/main/java/game/CpuPlayer.java:280
↓ 2 callersMethodgetPresidentLegislativeChoices
Gets the legislative choices available for the President. @throws IllegalStateException if called when the state is not
backend/src/main/java/game/SecretHitlerGame.java:679
↓ 2 callersMethodgetRoleID
* Determine the role ID of the player. * @return the number of players with the same role that appear before the player. Otherwise, defaults to 0
frontend/src/custom-alert/RoleAlert.js:91
↓ 2 callersMethodgetRound
Gets the current round number. The round is incremented whenever it's a new president's turn, starting at 1 at the start of the game.
backend/src/main/java/game/SecretHitlerGame.java:356
↓ 2 callersMethodhasGameFinished
Returns whether the game has reached an ending victory state.
backend/src/main/java/game/SecretHitlerGame.java:381
↓ 2 callersMethodinvestigatePlayer
Investigates the party identity of a given player. @param username the username of the player to investigate. @throws IllegalStateException if cal
backend/src/main/java/game/SecretHitlerGame.java:919
↓ 2 callersMethodisFascistVictory
Determines whether the fascist party won by policy count. @return true if the number of Fascist Policies {@literal >=} {@code FASCIST_POLICIES_TO_WIN}
backend/src/main/java/game/datastructures/board/Board.java:96
↓ 2 callersMethodisLiberalVictory
Determines whether the liberal party won by policy count. @return true if the number of Liberal Policies {@literal >=} {@code LIBERAL_POLICIES_TO_WIN}
backend/src/main/java/game/datastructures/board/Board.java:87
↓ 2 callersMethodmarkAsCpu
()
backend/src/main/java/game/datastructures/Player.java:51
↓ 2 callersMethodonEnactPolicy
Called AFTER a policy has been enacted, and sets the state according to any consequences. @modifies this @effects sets the state to handle any presid
backend/src/main/java/game/SecretHitlerGame.java:832
↓ 2 callersMethodpresidentDiscardPolicy
Discards the Policy in the list of presidential policy options. @param index the index of the policy in the list of legislative choices to
backend/src/main/java/game/SecretHitlerGame.java:701
↓ 2 callersFunctionregisterValidSW
(swUrl, config)
frontend/src/serviceWorker.js:57
↓ 2 callersMethodregisterVote
Registers a vote for chancellor from a given player. @param username the name of the player giving the vote. @param vote the vote of the player (
backend/src/main/java/game/SecretHitlerGame.java:484
↓ 2 callersMethodremovePlayerFromList
(String username, List<Player> playerList)
backend/src/main/java/game/CpuPlayer.java:198
↓ 2 callersMethodresetTimeout
Resets the internal timeout for this lobby. @effects The lobby will time out in {@code TIMEOUT_DURATION_MS} ms from now.
backend/src/main/java/server/util/Lobby.java:70
↓ 2 callersMethodstoreDatabaseBackup
()
backend/src/main/java/server/SecretHitlerServer.java:293
↓ 2 callersMethodupdate
Allows the CpuPlayer to update assumptions after legislation is passed. @param game
backend/src/main/java/game/CpuPlayer.java:111
↓ 2 callersMethodupdateUser
Sends a message to the specified user with the current game state. @param ctx the WsContext websocket context. @effects a message containing a JSONOb
backend/src/main/java/server/util/Lobby.java:368
↓ 2 callersMethodverifyIsChancellor
Verifies that the user is the chancellor. @param name String name of the user. @param lobby the Lobby that the game is in. @throws RuntimeException
backend/src/main/java/server/SecretHitlerServer.java:740
↓ 1 callersMethodaddUser
Adds a user (websocket connection) to the lobby. @param context the websocket connection context. @param name the name of the player to be added.
backend/src/main/java/server/util/Lobby.java:170
next →1–100 of 258, ranked by callers