Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/benletchford/stratego.io
/ functions
Functions
127 in github.com/benletchford/stratego.io
⨍
Functions
127
◇
Types & classes
27
↓ 17 callers
Function
check_move
Validate a move and return the move type. Port of models.py check_move.
src/game_logic.rs:16
↓ 16 callers
Function
make_game
()
src/game_logic.rs:289
↓ 10 callers
Method
get_piece
(&self, pos: &Position)
src/models.rs:86
↓ 8 callers
Function
random
()
client/src/components/overlay.rs:22
↓ 6 callers
Method
hex_string_short
(&self)
src/api.rs:495
↓ 5 callers
Method
is_empty
(&self)
src/models.rs:12
↓ 5 callers
Method
set_last_move
(&mut self, last_move: serde_json::Value)
src/models.rs:112
↓ 4 callers
Function
create_item
(rect: &Rect, kind: &str)
client/src/components/overlay.rs:43
↓ 4 callers
Method
flip_turn
(&mut self)
src/models.rs:104
↓ 4 callers
Function
get_cells_between_inclusive
Get all cells between two positions (inclusive), moving on a single axis.
src/game_logic.rs:262
↓ 4 callers
Method
get_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 callers
Function
get_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 callers
Method
save_game
Save a game: updates in-memory cache immediately, writes to disk in the background.
src/storage.rs:41
↓ 4 callers
Function
unknown_row
(opponent_side: i32)
src/board_utils.rs:120
↓ 3 callers
Function
check_response
Check response status and return the body text as an error for non-success responses.
client/src/api.rs:10
↓ 3 callers
Method
delete_piece
(&mut self, pos: &Position)
src/models.rs:100
↓ 3 callers
Method
load_game_by_id
Load a game by its ID. Checks cache first, falls back to disk.
src/storage.rs:69
↓ 3 callers
Method
move_piece
(&mut self, from: &Position, to: &Position)
src/models.rs:94
↓ 3 callers
Method
set_blocks
Place water blocks on the board
src/models.rs:162
↓ 3 callers
Function
svg_to_data_uri
(svg: &str)
src/build.rs:324
↓ 2 callers
Function
build_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 callers
Function
collect_color_svg_files
(dir: &Path)
src/build.rs:306
↓ 2 callers
Function
display_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 callers
Function
get_game
(player_hash: &str)
client/src/api.rs:79
↓ 2 callers
Method
get_game_lock
(&self, game_id: &str)
src/main.rs:33
↓ 2 callers
Method
get_last_move
(&self)
src/models.rs:108
↓ 2 callers
Method
has_ended
(&self)
src/models.rs:116
↓ 2 callers
Method
is_active
(&self)
client/src/poll.rs:26
↓ 2 callers
Function
is_supported
()
client/src/notify.rs:38
↓ 2 callers
Function
leave_pool
Best-effort removal of a pool entry (called on navigation away).
client/src/api.rs:111
↓ 2 callers
Method
load_game_by_hash
Load a game by a hash (red_hash, blue_hash, or join_hash).
src/storage.rs:85
↓ 2 callers
Function
notify
Show a notification if permission is granted.
client/src/notify.rs:15
↓ 2 callers
Function
opposite_side
(side: i32)
src/board_utils.rs:112
↓ 2 callers
Function
replace_color
(svg: &str, target_color: &str)
src/build.rs:329
↓ 2 callers
Function
request_permission
Request notification permission (no-op if already granted/denied).
client/src/notify.rs:5
↓ 2 callers
Function
reverse_position
Reverse a position for blue perspective: (x,y) → (9-x, 9-y)
src/board_utils.rs:6
↓ 2 callers
Method
set_blue_setup
Set blue's initial piece setup into rows 0-3 (reversed)
src/models.rs:144
↓ 2 callers
Method
set_red_setup
Set red's initial piece setup into rows 6-9
src/models.rs:135
↓ 2 callers
Function
sleep_ms
(ms: u32)
client/src/poll.rs:4
↓ 1 callers
Method
as_piece
(&self)
src/models.rs:24
↓ 1 callers
Function
check_attack
Determine the outcome of an attack. Port of models.py _check_attack.
src/game_logic.rs:89
↓ 1 callers
Function
check_moves_are_same_piece
Check if 4 consecutive moves involve the same piece.
src/game_logic.rs:253
↓ 1 callers
Function
color_map
()
src/build.rs:432
↓ 1 callers
Function
copy_dir_contents
(src: &Path, dst: &Path)
src/build.rs:138
↓ 1 callers
Function
create_game
(board: &str)
client/src/api.rs:23
↓ 1 callers
Function
default_setup
Default 4x10 board setup using RANKS from shared crate.
client/src/components/setup.rs:9
↓ 1 callers
Function
ensure_wasm_bindgen_cli
Ensure wasm-bindgen-cli is available with the correct version, installing if needed.
src/build.rs:154
↓ 1 callers
Function
generate_graphics_css
Generate graphics.css from SVG source files.
src/build.rs:216
↓ 1 callers
Function
generate_index_html
Find the wasm-bindgen JS and wasm filenames in the dist directory.
src/build.rs:91
↓ 1 callers
Function
get_wasm_bindgen_version
Read the wasm-bindgen version from Cargo.lock.
src/build.rs:190
↓ 1 callers
Method
get_write_lock
(&self, game_id: &str)
src/storage.rs:33
↓ 1 callers
Function
has_fill_attribute
(tag: &str)
src/build.rs:353
↓ 1 callers
Function
hide_side
Replace opponent pieces with unknown markers.
src/board_utils.rs:99
↓ 1 callers
Function
inject_fill_on_svg_root
(svg: &str, color: &str)
src/build.rs:335
↓ 1 callers
Method
is_occupied
(&self)
src/models.rs:20
↓ 1 callers
Function
is_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 callers
Function
join_game
(join_hash: &str, board: &str)
client/src/api.rs:36
↓ 1 callers
Function
join_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 callers
Method
load_game_by_player_hash
Look up a game by player_hash: try red first, then blue. Returns (game, side).
src/storage.rs:92
↓ 1 callers
Function
load_rank_style
()
client/src/config.rs:53
↓ 1 callers
Function
load_saved_setup
Try to load board from localStorage, fall back to default.
client/src/components/setup.rs:26
↓ 1 callers
Function
make_move
( player_hash: &str, side: i32, from: &Position, to: &Position, )
client/src/api.rs:53
↓ 1 callers
Function
needs_build
Check whether the client dist directory has already been built.
src/build.rs:9
↓ 1 callers
Function
parse_board
Parse a board from a JSON value.
client/src/components/game.rs:50
↓ 1 callers
Function
parse_last_move
Parse the server's last_move JSON into our LastMoveInfo struct.
client/src/components/game.rs:13
↓ 1 callers
Function
poll_pool
Check if a pool entry has been matched. Returns `Some(player_hash)` if matched.
client/src/api.rs:131
↓ 1 callers
Function
replace_hex_color_ci
(input: &str, from: &str, to: &str)
src/build.rs:377
↓ 1 callers
Function
replace_short_hex_color
(input: &str, from: &str, to: &str)
src/build.rs:399
↓ 1 callers
Function
save_rank_style
(style: RankStyle)
client/src/config.rs:65
↓ 1 callers
Function
save_setup
Save board to localStorage.
client/src/components/setup.rs:41
↓ 1 callers
Function
start_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 callers
Function
start_pool_poller
Polls `GET /api/pool/status?poll_id=...` until a match is found.
client/src/poll.rs:73
↓ 1 callers
Method
stop
(&self)
client/src/poll.rs:22
↓ 1 callers
Function
will_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 callers
Function
write_game_to_disk
Write game state and index files to disk (called from background task).
src/storage.rs:123
Function
App
()
client/src/app.rs:18
Function
Board
(children: Children)
client/src/components/board.rs:17
Function
ConnectionIndicator
()
client/src/components/connection.rs:6
Function
Grid
( board: Signal<Board>, side: Signal<i32>, last_move: Signal<Option<LastMoveInfo>>, set_move:
client/src/components/grid.rs:25
Function
HomePage
()
client/src/components/home.rs:13
Function
Loading
( #[prop(into)] message: Signal<String>, )
client/src/components/loading.rs:6
Function
OverlayGraphics
()
client/src/components/overlay.rs:86
Function
PieceView
( piece: Piece, #[prop(default = false)] phantom: bool, #[prop(optional)] dead_piece: Option<Piece
client/src/components/piece.rs:14
Function
PlayPage
(#[prop(into)] hash: String)
client/src/components/game.rs:59
Function
PlayWrapper
()
client/src/app.rs:52
Function
SetupJoinWrapper
()
client/src/app.rs:41
Function
SetupPage
( #[prop(into)] mode: String, #[prop(into)] hash: String, )
client/src/components/setup.rs:53
Function
api_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
Function
create_handler
( State(state): State<Arc<AppState>>, Form(form): Form<CreateForm>, )
src/api.rs:28
Function
default_port
()
src/main.rs:41
Method
empty_board
()
src/models.rs:82
Method
fmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/game_logic.rs:8
Function
game_handler
( State(state): State<Arc<AppState>>, Query(query): Query<GameQuery>, )
src/api.rs:297
Method
get_opponent_hash
(&self, player_hash: &str)
src/models.rs:124
Function
get_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
Method
is_water
(&self)
src/models.rs:16
Function
join_handler
( State(state): State<Arc<AppState>>, Form(form): Form<JoinForm>, )
src/api.rs:86
Function
main
()
client/build.rs:3
Function
main
()
client/src/main.rs:8
Function
main
()
src/main.rs:77
next →
1–100 of 127, ranked by callers