frontend
    Preparing search index...

    Function useNapoleonGame

    • Hook that manages Napoleon game state, bidding, declarations, and player actions.

      Returns {
          apiExec: (
              ...args: [
                  command: | "reset"
                  | "log"
                  | "play"
                  | "exchange"
                  | "next"
                  | "nextround"
                  | "hint"
                  | "bid"
                  | "trump"
                  | "setdifficulty"
                  | "setlimit"
                  | "setminbid",
                  bid?: number,
                  trumpSuit?: number,
                  adjutantSuit?: number,
                  adjutantValue?: number,
              ],
          ) => Promise<void>;
          clearSelection: () => void;
          error: string | null;
          handleBid: (bid: number) => void;
          handleConfigChange: (
              key: NumberKeys<NapoleonConfig>,
              value: string,
          ) => void;
          handleExchange: (discardIndex: number) => void;
          handleHint: () => Promise<void>;
          handleNextRound: () => void;
          handleNextTrick: () => void;
          handlePass: () => void;
          handlePlay: () => void;
          handleTrumpDeclaration: (
              trumpSuit: number,
              adjutantSuit: number,
              adjutantValue: number,
          ) => void;
          hint: NapoleonHint | null;
          hintError: string | null;
          hintLoading: boolean;
          loading: boolean;
          napoleonConfig: NapoleonConfig;
          retry: () => Promise<void>;
          selectedCardIndices: number[];
          state: NapoleonResponse | null;
          toggleCard: (idx: number) => void;
      }