Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Kirin v0.2.3-5-ge9b2f59
Logo
  • The system manual
    • The Kirin System
    • Introduction
    • Building and Testing
    • Building Kirin
    • Testing
    • Testing
    • Contributing
    • Architecture
    • Search Algorithm
    • Evaluation
    • NNUE Evaluation
    • UCI Protocol
    • Time Management
    • Measuring Strength
    • API Reference
    • Performance
    • Introduction
    • Data Structures
    • Path Generation
    • Blocker Detection and Relocation
    • A* Pathfinding
    • Move Planning
    • Utility Functions and Bitboard Helpers
    • Debug Functions
    • Piece Identity and Physical Setup
    • Desync Detection and Recovery
    • The LED Highlight Subsystem
    • Integration Guide
    • Overview
    • Building the Software
    • Wiring the Hall Effect Sensors
    • Connecting the Gantry
    • Headless Operator UI: OLED and Buttons
    • First Power-On Procedure
    • Running Your First Game
    • Troubleshooting
    • Tunable Parameters
    • The Application Layer
    • Playing a Game
    • Match Review
    • Puzzles
    • The Touch Interface
    • Networked Play
    • Accounts, Devices and Ratings
    • The Live Board Feed and Telemetry
    • Broadcast Mirroring
    • The Lichess Integration
    • The Golden Image
    • Over-the-Air Updates
    • The First-Run Wizard
    • Security Posture
    • Decision Register
    • GPIO Pin Reference
    • UCI Option Reference
    • Software Command Reference
    • Original 12-Week Development Timeline
    • Glossary
    • Glossary
    • References
    • References

API reference

  • API reference
    • Chess engine (kirin_engine)
      • engine/attacks.cpp
      • engine/attacks.h
      • engine/bitboard.cpp
      • engine/bitboard.h
      • engine/engine.h
      • engine/evaluation.cpp
      • engine/evaluation.h
      • engine/movegen.cpp
      • engine/movegen.h
      • engine/nnue.cpp
      • engine/nnue.h
      • engine/position.cpp
      • engine/position.h
      • engine/san.cpp
      • engine/san.h
      • engine/search.cpp
      • engine/search.h
      • engine/types.cpp
      • engine/types.h
      • engine/uci.cpp
      • engine/uci.h
      • engine/utils.cpp
      • engine/utils.h
      • engine/zobrist.cpp
      • engine/zobrist.h
    • Hardware layer (kirin_hardware)
      • hardware/board_interpreter.cpp
      • hardware/board_interpreter.h
      • hardware/board_scanner.cpp
      • hardware/board_scanner.h
      • hardware/board_setup_planner.cpp
      • hardware/board_setup_planner.h
      • hardware/button_controller.cpp
      • hardware/button_controller.h
      • hardware/display_controller.cpp
      • hardware/display_controller.h
      • hardware/game_controller.cpp
      • hardware/game_controller.h
      • hardware/gantry_controller.cpp
      • hardware/gantry_controller.h
      • hardware/gantry_tuning.cpp
      • hardware/gantry_tuning.h
      • hardware/led_controller.cpp
      • hardware/led_controller.h
      • hardware/piece_tracker.h
    • Application layer
      • app/analysis_service.cpp
      • app/analysis_service.h
      • app/backend_factory.cpp
      • app/backend_factory.h
      • app/board_backend.h
      • app/board_recovery.cpp
      • app/board_recovery.h
      • app/broadcast.cpp
      • app/broadcast.h
      • app/broadcast_session.cpp
      • app/broadcast_session.h
      • app/engine_hint.cpp
      • app/engine_hint.h
      • app/engine_interface.h
      • app/engine_legal_moves.cpp
      • app/engine_legal_moves.h
      • app/fen_identity.cpp
      • app/fen_identity.h
      • app/game_analysis.cpp
      • app/game_analysis.h
      • app/game_analyzer.cpp
      • app/game_analyzer.h
      • app/game_clock.cpp
      • app/game_clock.h
      • app/game_record.cpp
      • app/game_record.h
      • app/game_recorder.cpp
      • app/game_recorder.h
      • app/game_session.cpp
      • app/game_session.h
      • app/game_store.cpp
      • app/game_store.h
      • app/handicap.cpp
      • app/handicap.h
      • app/hardware_backend.cpp
      • app/hardware_backend.h
      • app/identity_replay.cpp
      • app/identity_replay.h
      • app/json_lite.cpp
      • app/json_lite.h
      • app/led_assist.cpp
      • app/led_assist.h
      • app/led_subsystem.cpp
      • app/led_subsystem.h
      • app/linked_engine.cpp
      • app/linked_engine.h
      • app/network_opponent.cpp
      • app/network_opponent.h
      • app/network_transport.h
      • app/personality.cpp
      • app/personality.h
      • app/pgn.cpp
      • app/pgn.h
      • app/player_rating.cpp
      • app/player_rating.h
      • app/puzzle.cpp
      • app/puzzle.h
      • app/puzzle_book.cpp
      • app/puzzle_book.h
      • app/puzzle_history.cpp
      • app/puzzle_history.h
      • app/puzzle_led.cpp
      • app/puzzle_led.h
      • app/puzzle_session.cpp
      • app/puzzle_session.h
      • app/review_session.cpp
      • app/review_session.h
      • app/sim_backend.cpp
      • app/sim_backend.h
    • Command-line entry point
      • main.cpp
Back to top

app/engine_legal_moves.h¶

ILegalMoveSource backed by the in-process engine.

The only adapter that links movegen internals, so LedAssist doesn’t have to (PLAN §6). It reads the engine’s global position, which on GameSession’s worker thread is the live position right after a move is applied. bestTargetFrom returns a lightweight heuristic pick for the over-budget lift fallback (prefer a capture, then centrality) — no engine search on that path.

namespace kirin
class EngineLegalMoveSource : public kirin::ILegalMoveSource¶
#include <engine_legal_moves.h>

Public Functions

virtual std::vector<LegalTarget> legalTargetsFrom(int square) override¶
virtual int bestTargetFrom(int square) override¶
Next
app/fen_identity.cpp
Previous
app/engine_legal_moves.cpp
Copyright © 2026, Kirin Autonomy, Inc. All rights reserved
Made with Furo
On this page
  • app/engine_legal_moves.h
    • kirin
      • kirin::EngineLegalMoveSource
        • legalTargetsFrom()
        • bestTargetFrom()