MCPcopy Create free account

hub / github.com/benletchford/stratego.io / functions

Functions127 in github.com/benletchford/stratego.io

↓ 17 callersFunctioncheck_move
Validate a move and return the move type. Port of models.py check_move.
src/game_logic.rs:16
↓ 16 callersFunctionmake_game
()
src/game_logic.rs:289
↓ 10 callersMethodget_piece
(&self, pos: &Position)
src/models.rs:86
↓ 8 callersFunctionrandom
()
client/src/components/overlay.rs:22
↓ 6 callersMethodhex_string_short
(&self)
src/api.rs:495
↓ 5 callersMethodis_empty
(&self)
src/models.rs:12
↓ 5 callersMethodset_last_move
(&mut self, last_move: serde_json::Value)
src/models.rs:112
↓ 4 callersFunctioncreate_item
(rect: &Rect, kind: &str)
client/src/components/overlay.rs:43
↓ 4 callersMethodflip_turn
(&mut self)
src/models.rs:104
↓ 4 callersFunctionget_cells_between_inclusive
Get all cells between two positions (inclusive), moving on a single axis.
src/game_logic.rs:262
↓ 4 callersMethodget_game_id_by_hash
Get the game_id for a given hash, without loading the full game. Checks index cache first, falls back to disk.
src/storage.rs:104
↓ 4 callersFunctionget_sendable_game
Build the game dict to send to a player, hiding sensitive data. Port of board_utils.py get_sendable_game.
src/board_utils.rs:13
↓ 4 callersMethodsave_game
Save a game: updates in-memory cache immediately, writes to disk in the background.
src/storage.rs:41
↓ 4 callersFunctionunknown_row
(opponent_side: i32)
src/board_utils.rs:120
↓ 3 callersFunctioncheck_response
Check response status and return the body text as an error for non-success responses.
client/src/api.rs:10
↓ 3 callersMethoddelete_piece
(&mut self, pos: &Position)
src/models.rs:100
↓ 3 callersMethodload_game_by_id
Load a game by its ID. Checks cache first, falls back to disk.
src/storage.rs:69
↓ 3 callersMethodmove_piece
(&mut self, from: &Position, to: &Position)
src/models.rs:94
↓ 3 callersMethodset_blocks
Place water blocks on the board
src/models.rs:162
↓ 3 callersFunctionsvg_to_data_uri
(svg: &str)
src/build.rs:324
↓ 2 callersFunctionbuild_client
Build the client WASM frontend: generate graphics CSS, compile to wasm, run wasm-bindgen, and assemble the dist directory.
src/build.rs:15
↓ 2 callersFunctioncollect_color_svg_files
(dir: &Path)
src/build.rs:306
↓ 2 callersFunctiondisplay_rank
Map an internal rank to its display rank based on the ranking style. EU: 1=Marshal(highest) .. 9=Scout(lowest), S=Spy US: 10=Marshal(highest) .. 2=Sc
client/src/config.rs:17
↓ 2 callersFunctionget_game
(player_hash: &str)
client/src/api.rs:79
↓ 2 callersMethodget_game_lock
(&self, game_id: &str)
src/main.rs:33
↓ 2 callersMethodget_last_move
(&self)
src/models.rs:108
↓ 2 callersMethodhas_ended
(&self)
src/models.rs:116
↓ 2 callersMethodis_active
(&self)
client/src/poll.rs:26
↓ 2 callersFunctionis_supported
()
client/src/notify.rs:38
↓ 2 callersFunctionleave_pool
Best-effort removal of a pool entry (called on navigation away).
client/src/api.rs:111
↓ 2 callersMethodload_game_by_hash
Load a game by a hash (red_hash, blue_hash, or join_hash).
src/storage.rs:85
↓ 2 callersFunctionnotify
Show a notification if permission is granted.
client/src/notify.rs:15
↓ 2 callersFunctionopposite_side
(side: i32)
src/board_utils.rs:112
↓ 2 callersFunctionreplace_color
(svg: &str, target_color: &str)
src/build.rs:329
↓ 2 callersFunctionrequest_permission
Request notification permission (no-op if already granted/denied).
client/src/notify.rs:5
↓ 2 callersFunctionreverse_position
Reverse a position for blue perspective: (x,y) → (9-x, 9-y)
src/board_utils.rs:6
↓ 2 callersMethodset_blue_setup
Set blue's initial piece setup into rows 0-3 (reversed)
src/models.rs:144
↓ 2 callersMethodset_red_setup
Set red's initial piece setup into rows 6-9
src/models.rs:135
↓ 2 callersFunctionsleep_ms
(ms: u32)
client/src/poll.rs:4
↓ 1 callersMethodas_piece
(&self)
src/models.rs:24
↓ 1 callersFunctioncheck_attack
Determine the outcome of an attack. Port of models.py _check_attack.
src/game_logic.rs:89
↓ 1 callersFunctioncheck_moves_are_same_piece
Check if 4 consecutive moves involve the same piece.
src/game_logic.rs:253
↓ 1 callersFunctioncolor_map
()
src/build.rs:432
↓ 1 callersFunctioncopy_dir_contents
(src: &Path, dst: &Path)
src/build.rs:138
↓ 1 callersFunctioncreate_game
(board: &str)
client/src/api.rs:23
↓ 1 callersFunctiondefault_setup
Default 4x10 board setup using RANKS from shared crate.
client/src/components/setup.rs:9
↓ 1 callersFunctionensure_wasm_bindgen_cli
Ensure wasm-bindgen-cli is available with the correct version, installing if needed.
src/build.rs:154
↓ 1 callersFunctiongenerate_graphics_css
Generate graphics.css from SVG source files.
src/build.rs:216
↓ 1 callersFunctiongenerate_index_html
Find the wasm-bindgen JS and wasm filenames in the dist directory.
src/build.rs:91
↓ 1 callersFunctionget_wasm_bindgen_version
Read the wasm-bindgen version from Cargo.lock.
src/build.rs:190
↓ 1 callersMethodget_write_lock
(&self, game_id: &str)
src/storage.rs:33
↓ 1 callersFunctionhas_fill_attribute
(tag: &str)
src/build.rs:353
↓ 1 callersFunctionhide_side
Replace opponent pieces with unknown markers.
src/board_utils.rs:99
↓ 1 callersFunctioninject_fill_on_svg_root
(svg: &str, color: &str)
src/build.rs:335
↓ 1 callersMethodis_occupied
(&self)
src/models.rs:20
↓ 1 callersFunctionis_piece_between
Check if any piece exists between from and to positions (for scout moves). Port of models.py _is_piece_between.
src/game_logic.rs:139
↓ 1 callersFunctionjoin_game
(join_hash: &str, board: &str)
client/src/api.rs:36
↓ 1 callersFunctionjoin_pool
Join the matchmaking pool. Returns JSON with either: - `{"matched": true, "player_hash": "..."}` if immediately matched - `{"matched": false, "poll_id
client/src/api.rs:93
↓ 1 callersMethodload_game_by_player_hash
Look up a game by player_hash: try red first, then blue. Returns (game, side).
src/storage.rs:92
↓ 1 callersFunctionload_rank_style
()
client/src/config.rs:53
↓ 1 callersFunctionload_saved_setup
Try to load board from localStorage, fall back to default.
client/src/components/setup.rs:26
↓ 1 callersFunctionmake_move
( player_hash: &str, side: i32, from: &Position, to: &Position, )
client/src/api.rs:53
↓ 1 callersFunctionneeds_build
Check whether the client dist directory has already been built.
src/build.rs:9
↓ 1 callersFunctionparse_board
Parse a board from a JSON value.
client/src/components/game.rs:50
↓ 1 callersFunctionparse_last_move
Parse the server's last_move JSON into our LastMoveInfo struct.
client/src/components/game.rs:13
↓ 1 callersFunctionpoll_pool
Check if a pool entry has been matched. Returns `Some(player_hash)` if matched.
client/src/api.rs:131
↓ 1 callersFunctionreplace_hex_color_ci
(input: &str, from: &str, to: &str)
src/build.rs:377
↓ 1 callersFunctionreplace_short_hex_color
(input: &str, from: &str, to: &str)
src/build.rs:399
↓ 1 callersFunctionsave_rank_style
(style: RankStyle)
client/src/config.rs:65
↓ 1 callersFunctionsave_setup
Save board to localStorage.
client/src/components/setup.rs:41
↓ 1 callersFunctionstart_game_poller
Polls `GET /api/game?player_hash=...` at a fixed interval. Calls `on_update` whenever the game's `modified` timestamp changes.
client/src/poll.rs:33
↓ 1 callersFunctionstart_pool_poller
Polls `GET /api/pool/status?poll_id=...` until a match is found.
client/src/poll.rs:73
↓ 1 callersMethodstop
(&self)
client/src/poll.rs:22
↓ 1 callersFunctionwill_violate_two_square_rule
Check if the proposed move violates the two-square rule. Port of models.py will_violate_two_square_rule.
src/game_logic.rs:171
↓ 1 callersFunctionwrite_game_to_disk
Write game state and index files to disk (called from background task).
src/storage.rs:123
FunctionApp
()
client/src/app.rs:18
FunctionBoard
(children: Children)
client/src/components/board.rs:17
FunctionConnectionIndicator
()
client/src/components/connection.rs:6
FunctionGrid
( board: Signal<Board>, side: Signal<i32>, last_move: Signal<Option<LastMoveInfo>>, set_move:
client/src/components/grid.rs:25
FunctionHomePage
()
client/src/components/home.rs:13
FunctionLoading
( #[prop(into)] message: Signal<String>, )
client/src/components/loading.rs:6
FunctionOverlayGraphics
()
client/src/components/overlay.rs:86
FunctionPieceView
( piece: Piece, #[prop(default = false)] phantom: bool, #[prop(optional)] dead_piece: Option<Piece
client/src/components/piece.rs:14
FunctionPlayPage
(#[prop(into)] hash: String)
client/src/components/game.rs:59
FunctionPlayWrapper
()
client/src/app.rs:52
FunctionSetupJoinWrapper
()
client/src/app.rs:41
FunctionSetupPage
( #[prop(into)] mode: String, #[prop(into)] hash: String, )
client/src/components/setup.rs:53
Functionapi_base_url
Base URL for API calls. Empty string means same-origin (relative URLs). Set via `API_BASE_URL` env var at compile time for cross-origin deployments.
client/src/config.rs:3
Functioncreate_handler
( State(state): State<Arc<AppState>>, Form(form): Form<CreateForm>, )
src/api.rs:28
Functiondefault_port
()
src/main.rs:41
Methodempty_board
()
src/models.rs:82
Methodfmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/game_logic.rs:8
Functiongame_handler
( State(state): State<Arc<AppState>>, Query(query): Query<GameQuery>, )
src/api.rs:297
Methodget_opponent_hash
(&self, player_hash: &str)
src/models.rs:124
Functionget_sendable_board
Build the board to send to a player, hiding opponent pieces. Port of board_utils.py get_sendable_board.
src/board_utils.rs:67
Methodis_water
(&self)
src/models.rs:16
Functionjoin_handler
( State(state): State<Arc<AppState>>, Form(form): Form<JoinForm>, )
src/api.rs:86
Functionmain
()
client/build.rs:3
Functionmain
()
client/src/main.rs:8
Functionmain
()
src/main.rs:77
next →1–100 of 127, ranked by callers