File tree Expand file tree Collapse file tree 6 files changed +10
-155
lines changed
AnalysisOnline(abandoned) Expand file tree Collapse file tree 6 files changed +10
-155
lines changed Original file line number Diff line number Diff line change 11import ShowCards from "../ShowCards/ShowCards" ;
22import "./index.css"
3- import { CompleteBoard , ShowResultsContext } from "../../views/Show/ShowResults" ;
3+ import { ShowResultsContext } from "../../views/Show/ShowResults" ;
44import { PropsWithChildren } from "react" ;
5+ import Board from "../../models/Board" ;
56
67interface ShowAllBoardsProps extends PropsWithChildren {
78 beautify ?: boolean ;
@@ -15,7 +16,7 @@ export default function ShowAllBoards(props: ShowAllBoardsProps) {
1516 ( context ) =>
1617 (
1718 < div className = "all-boards" >
18- { context . all_boards . map ( ( board : CompleteBoard , idx : number ) => < ShowCards key = { idx } board = { board . board } dds = { context . dds } { ...props } /> ) }
19+ { context . all_boards . map ( ( board : Board , idx : number ) => < ShowCards key = { idx } board = { board } dds = { context . dds } { ...props } /> ) }
1920 </ div >
2021 )
2122 }
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export default class Board {
2626 Shand : Hand ;
2727 Ehand : Hand ;
2828 Whand : Hand ;
29+ ddsTricks ?: string | ( string | number ) [ ] [ ] ;
2930
3031 constructor ( boardnum : number ) {
3132 this . boardnum = boardnum ;
Original file line number Diff line number Diff line change @@ -35,10 +35,10 @@ function Analysis() {
3535 useMemo ( ( ) => {
3636 async function countTricks ( ) {
3737 for ( const board of all_boards ) {
38- if ( ! board . ddtricks ) {
39- board . ddtricks = await analyzeOffline ( board . board . getAllHands ( ) ) ;
38+ if ( ! board . ddsTricks ) {
39+ board . ddsTricks = await analyzeOffline ( board . getAllHands ( ) ) ;
4040 }
41- tmp = MatrixAdd ( tmp , board . ddtricks as ( string | number ) [ ] [ ] ) ;
41+ tmp = MatrixAdd ( tmp , board . ddsTricks as ( string | number ) [ ] [ ] ) ;
4242 }
4343 return Promise . resolve ( tmp ) ;
4444 }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ export default function DealWithHands() {
134134
135135 </ div >
136136 { useMemo (
137- ( ) => < ShowResults all_boards = { boards . map ( ( b : Board ) => { return { board : b } } ) } beautify = { beautify } dds = { DDS } /> ,
137+ ( ) => < ShowResults all_boards = { boards } beautify = { beautify } dds = { DDS } /> ,
138138 [ DDS , beautify , boards ]
139139 ) }
140140 </ >
Original file line number Diff line number Diff line change @@ -3,19 +3,14 @@ import ShowAllBoards from "../../Components/ShowAllBoards/ShowAllBoards";
33import Analysis from "../Analysis/Analysis" ;
44import Board from "../../models/Board" ;
55
6- export interface CompleteBoard {
7- board : Board ;
8- ddtricks ?: ( string | number ) [ ] [ ] | string ;
9- }
10-
116interface ShowResultsProps {
12- all_boards : CompleteBoard [ ] ;
7+ all_boards : Board [ ] ;
138 dds : boolean ;
149 beautify ?: boolean ;
1510}
1611
1712interface ShowResultsContextProps {
18- all_boards : CompleteBoard [ ] ;
13+ all_boards : Board [ ] ;
1914 dds : boolean ;
2015}
2116
You can’t perform that action at this time.
0 commit comments