Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/GoodStartLabs/AI_Diplomacy
/ functions
Functions
2,689 in github.com/GoodStartLabs/AI_Diplomacy
⨍
Functions
2,689
◇
Types & classes
474
↓ 4 callers
Method
createColLabel
(htmlFor, title)
diplomacy/web/src/gui/components/forms.jsx:103
↓ 4 callers
Method
createLabel
(htmFor, title, className)
diplomacy/web/src/gui/components/forms.jsx:99
↓ 4 callers
Method
createOnSubmitCallback
(component, callback, resetState)
diplomacy/web/src/gui/components/forms.jsx:34
↓ 4 callers
Method
createSubmit
(title, large, onSubmit)
diplomacy/web/src/gui/components/forms.jsx:62
↓ 4 callers
Method
dialog
* open a dialog box * @param {DialogBuilder} builder - a callback to generate dialog GUI. Will be executed with a `onClose` callback * param
diplomacy/web/src/gui/pages/page.jsx:98
↓ 4 callers
Function
displayPhase
(skipMessages = false)
ai_animation/src/phase.ts:165
↓ 4 callers
Method
does_not_wait
Return True if the game does not wait anything to process its current phase. The game is not waiting is all **controlled** powers have de
diplomacy/engine/game.py:546
↓ 4 callers
Method
first_key
Get the lowest key from the dict.
diplomacy/utils/sorted_dict.py:118
↓ 4 callers
Method
first_value
Get the value associated to lowest key in the dict.
diplomacy/utils/sorted_dict.py:122
↓ 4 callers
Method
forceUpdate
()
diplomacy/web/src/gui/pages/content_game.jsx:230
↓ 4 callers
Function
gather_possible_orders
Returns a dictionary mapping each orderable location to the list of valid orders.
ai_diplomacy/utils.py:122
↓ 4 callers
Method
get
(key)
diplomacy/web/src/gui/utils/power_view.jsx:62
↓ 4 callers
Method
getAllPossibleOrders
(parameters, game)
diplomacy/web/src/diplomacy/client/channel.js:163
↓ 4 callers
Method
getPasswordID
()
diplomacy/web/src/gui/forms/join_form.jsx:38
↓ 4 callers
Method
getPowerNameID
()
diplomacy/web/src/gui/forms/join_form.jsx:34
↓ 4 callers
Method
getServerOrders
()
diplomacy/web/src/diplomacy/engine/game.js:427
↓ 4 callers
Method
get_class_name
Returns the class name in snake_case.
diplomacy/utils/network_data.py:56
↓ 4 callers
Method
get_dummy_power_names
Return sequence of not eliminated dummy power names.
diplomacy/engine/game.py:583
↓ 4 callers
Function
get_file_md5
Calculates a file MD5 hash :param file_path: The file path :return: The computed md5 hash
diplomacy/utils/convoy_paths.py:177
↓ 4 callers
Method
get_latest_timestamp
Return timestamp of latest data saved into this game (either current state, archived state or message). :return: a timestamp
diplomacy/engine/game.py:622
↓ 4 callers
Method
get_messages
Return a filtered dict of current messages for given output game role. See method filter_messages() about parameters.
diplomacy/server/server_game.py:127
↓ 4 callers
Method
get_model
Return model associated to current class, and cache it for future uses, to avoid multiple rendering of model for each class derived from
diplomacy/utils/jsonable.py:142
↓ 4 callers
Method
get_observer_addresses
Generate addresses (couples [power name, token]) of observers of this game.
diplomacy/server/server_game.py:267
↓ 4 callers
Method
get_phase_data
Return a GamePhaseData object representing current game.
diplomacy/engine/game.py:1575
↓ 4 callers
Method
get_phase_from_history
Return a game phase data corresponding to given phase from phase history.
diplomacy/engine/game.py:722
↓ 4 callers
Function
handler
Raises a timeout
diplomacy/daide/tests/test_daide_game.py:52
↓ 4 callers
Method
has_expected_controls_count
Return True if game has expected number of map powers to be controlled. If True, the game can start (if not yet started).
diplomacy/engine/game.py:560
↓ 4 callers
Method
has_username
Return True if users have given username.
diplomacy/server/users.py:74
↓ 4 callers
Method
intersection
Return coordinates of the intersection of (OM) with equilateral triangle, with M the point with coordinates (x_m, y_m). Only the intersec
diplomacy/utils/equilateral_triangle.py:134
↓ 4 callers
Method
isObserverGame
()
diplomacy/web/src/diplomacy/engine/game.js:300
↓ 4 callers
Method
isWater
()
diplomacy/web/src/gui/utils/province.js:114
↓ 4 callers
Function
is_dictionary
Check if given variable is a dictionary-like object. :param dict_to_check: Dictionary to check. :return: Indicates if the object is
diplomacy/utils/common.py:75
↓ 4 callers
Method
is_dummy
Return True if given power name is not currently controlled.
diplomacy/engine/game.py:542
↓ 4 callers
Method
is_observer_game
Return True if this game is an observer game.
diplomacy/engine/game.py:513
↓ 4 callers
Method
is_server_game
Return True if this game is a server game.
diplomacy/engine/game.py:521
↓ 4 callers
Method
is_server_power
(Network Method) Return True if this power is a server power.
diplomacy/engine/power.py:344
↓ 4 callers
Method
is_valid_password
Return True if given password matches user hashed password.
diplomacy/server/user.py:35
↓ 4 callers
Method
keys
Make sure keys() iterates on keys based on their priority.
diplomacy/utils/priority_dict.py:99
↓ 4 callers
Method
lastValue
()
diplomacy/web/src/diplomacy/utils/sorted_dict.js:96
↓ 4 callers
Function
log_llm_response
Appends a raw LLM response to a CSV log file.
ai_diplomacy/utils.py:347
↓ 4 callers
Method
onSelectLocation
(possibleLocations, powerName, orderType, orderPath)
diplomacy/web/src/gui/pages/content_game.jsx:268
↓ 4 callers
Method
onSelectVia
(location, powerName, orderPath)
diplomacy/web/src/gui/pages/content_game.jsx:283
↓ 4 callers
Method
pop_next_resp_notif
Pop the next response or notifcation from a DAIDE communications list :return: The next response or notifcation along with the updated l
diplomacy/daide/tests/test_daide_game.py:152
↓ 4 callers
Method
process
Process current game phase and move forward to next phase. :return: a triple containing: - previous game state (before
diplomacy/server/server_game.py:462
↓ 4 callers
Function
process_standard_game_inputs
Read in a game folder and return the overview, lmvs_data, and all_responses Args: path_to_folder: Path to the game folder. Must
analysis/analysis_helpers.py:24
↓ 4 callers
Method
reloadDeadlineTimer
(networkGame)
diplomacy/web/src/gui/pages/content_game.jsx:323
↓ 4 callers
Method
setController
(controller, controlType)
diplomacy/web/src/gui/utils/province.js:52
↓ 4 callers
Method
setPossibleOrders
(possibleOrders)
diplomacy/web/src/diplomacy/engine/game.js:486
↓ 4 callers
Method
setResult
(result)
diplomacy/web/src/diplomacy/utils/future.js:36
↓ 4 callers
Method
stop_daide_server
Stop one or all DAIDE TCP server :param game_id: game id of the DAIDE server. If None, all servers will be stopped :type gam
diplomacy/server/server.py:910
↓ 4 callers
Method
toDict
()
diplomacy/web/src/diplomacy/utils/sorted_dict.js:110
↓ 4 callers
Function
to_json_string
Converts to a JSON string, without escaping the '/' characters
diplomacy/web/svg_to_react.py:382
↓ 4 callers
Function
unit_dict_to_str
Converts a unit from the dictionary format to the string format e.g. ``{'unitType': 'Army', 'terrID': 6, 'countryId': 1, 'retreating': 'No'}`
diplomacy/integration/webdiplomacy_net/game.py:35
↓ 4 callers
Function
updateMomentStatus
()
ai_animation/src/debug/showRandomMoment.ts:49
↓ 4 callers
Method
user_is_omniscient
Return True if given username is omniscient for given game data. :param username: username :param server_game: game data
diplomacy/server/server.py:790
↓ 4 callers
Method
validate
(self, element)
diplomacy/utils/parsing.py:370
↓ 4 callers
Method
write_message
Write a message into the stream
diplomacy/daide/connection_handler.py:139
↓ 4 callers
Function
xScale
(index: number)
ai_animation/src/components/rotatingDisplay.ts:226
↓ 3 callers
Method
__disconnect
(error)
diplomacy/web/src/gui/pages/page.jsx:140
↓ 3 callers
Method
__get_engine_to_display
(initialEngine)
diplomacy/web/src/gui/pages/content_game.jsx:1035
↓ 3 callers
Method
__line_OM
(x_M, y_M)
diplomacy/web/src/gui/maps/common/equilateralTriangle.js:20
↓ 3 callers
Method
__line_om
Returns the slope and the intersect of the line between O and M :return: a, b - respectively the slope and the intercept of the line OM
diplomacy/utils/equilateral_triangle.py:56
↓ 3 callers
Method
_build_limit
Determines the maximum number of builds a power can do in an adjustment phase Note: - This function assumes that one unit c
diplomacy/engine/game.py:2981
↓ 3 callers
Function
_context
(game)
tests/test_possible_order_context.py:21
↓ 3 callers
Method
_cut_support
See if the order made by the unit cuts a support. If so, cut it. :param unit: The unit who is attacking (and cutting support)
diplomacy/engine/game.py:3874
↓ 3 callers
Method
_enqueue
Put a task in queue of tasks to process now.
diplomacy/server/scheduler.py:153
↓ 3 callers
Method
_extract_json_from_text_async
Async wrapper for _extract_json_from_text that runs CPU-intensive parsing in a thread pool.
ai_diplomacy/agent.py:103
↓ 3 callers
Method
_get_keys_interval
Get a couple of internal key positions (index of key_from, index of key_to) allowing to easily retrieve values in closed interval [index
diplomacy/utils/sorted_dict.py:210
↓ 3 callers
Method
_phase_abbr
Constructs a 5 character representation (S1901M) from a phase (SPRING 1901 MOVEMENT) :param phase: The full phase (e.g. SPRING 1901 MOVE
diplomacy/engine/game.py:3127
↓ 3 callers
Method
_send_get_request
Helper method to send a get request to the API endpoint
diplomacy/integration/webdiplomacy_net/api.py:259
↓ 3 callers
Function
_split_move
Return ('A BUD', 'TRI') from 'A BUD - TRI' (validated move only).
ai_diplomacy/possible_order_context.py:505
↓ 3 callers
Method
add
Add given game. :param game: a NetworkGame object. :type game: diplomacy.client.network_game.NetworkGame
diplomacy/client/game_instances_set.py:63
↓ 3 callers
Method
addToMyGames
(game)
diplomacy/web/src/gui/pages/page.jsx:326
↓ 3 callers
Method
addUserGame
(username, gameID)
diplomacy/web/src/gui/utils/dipStorage.jsx:104
↓ 3 callers
Method
add_omniscient_token
Set given token as omniscient token.
diplomacy/server/server_game.py:324
↓ 3 callers
Method
analyze_turn
Analyze a single turn for key moments
analyze_game_moments.py:356
↓ 3 callers
Function
animateMessageWords
(message: string, contentSpan: HTMLElement, messagesContainer: HTMLElement, onComplete: Function | null)
ai_animation/src/components/chatBubble.ts:20
↓ 3 callers
Method
as_omniscient_game
Return an omniscient game data object copy of this game.
diplomacy/server/server_game.py:188
↓ 3 callers
Method
assert_token
Check if given token is associated to an user, check if token is still valid, and link token to given connection handler. If any step fai
diplomacy/server/server.py:845
↓ 3 callers
Method
backup_now
Save backup of server data and loaded games immediately. :param force: if True, force to save server data and all loaded games
diplomacy/server/server.py:386
↓ 3 callers
Function
bfs_shortest_path
Performs BFS to find the shortest path from start_loc to a target satisfying is_target_func.
ai_diplomacy/possible_order_context.py:68
↓ 3 callers
Method
build_caches
Rebuilds the various caches
diplomacy/engine/game.py:1499
↓ 3 callers
Function
build_diplomacy_graph
Return graph[PROV]['ARMY'|'FLEET'] = list of 3-letter neighbour provinces. Works for dual-coast provinces by interrogating `abuts()` directly
ai_diplomacy/possible_order_context.py:18
↓ 3 callers
Method
clear
()
diplomacy/web/src/diplomacy/utils/sorted_dict.js:33
↓ 3 callers
Method
clearScheduleTimeout
()
diplomacy/web/src/gui/pages/content_game.jsx:305
↓ 3 callers
Function
connect
Connect to given hostname and port. :param hostname: a hostname :param port: a port :return: a Connection object connected.
diplomacy/client/connection.py:38
↓ 3 callers
Method
control
Control given power name with given username via given token.
diplomacy/server/server_game.py:351
↓ 3 callers
Method
disconnectGame
(gameID)
diplomacy/web/src/gui/pages/page.jsx:280
↓ 3 callers
Method
draw
Force a draw for this game, set status as COMPLETED and finish the game. :param winners: (optional) either None (all powers remaining to
diplomacy/engine/game.py:756
↓ 3 callers
Method
extendPhaseHistory
(phaseData)
diplomacy/web/src/diplomacy/engine/game.js:201
↓ 3 callers
Method
extend_phase_history
Add data from a game phase to game history. :param game_phase_data: a GamePhaseData object. :type game_phase_data: GamePhase
diplomacy/engine/game.py:735
↓ 3 callers
Function
find_convoy_path
Finds a convoy path from src to dest :param src: The source location (e.g. 'BRE') :param dest: The destination location (e.g. 'LON')
diplomacy/integration/webdiplomacy_net/orders.py:50
↓ 3 callers
Method
force_game_processing
Add a game to scheduler to be processed as soon as possible. Use this method instead of schedule_game() to explicitly add games with null
diplomacy/server/server.py:746
↓ 3 callers
Function
format_moves_dict
(title, moves_dict)
ai_diplomacy/narrative.py:140
↓ 3 callers
Method
from_stream
Builds a message from the stream :param stream: An opened Tornado stream. :type stream: tornado.iostream.BaseIOStream
diplomacy/daide/messages.py:70
↓ 3 callers
Method
from_string
Builds the clause from a string :param string: The string to use to build the clause :param on_error: The action to take whe
diplomacy/daide/clauses.py:477
↓ 3 callers
Method
game_can_start
Return True if server game can start. A game can start if all followings conditions are satisfied: - Game has not yet starte
diplomacy/server/server_game.py:114
↓ 3 callers
Function
getCurrentPhaseName
(page: Page)
ai_animation/tests/e2e/test-helpers.ts:187
↓ 3 callers
Function
getMapComponent
(mapName)
diplomacy/web/src/gui/pages/content_game.jsx:90
↓ 3 callers
Method
getMapInfo
()
diplomacy/web/src/gui/pages/content_game.jsx:301
← previous
next →
301–400 of 2,689, ranked by callers