-
Notifications
You must be signed in to change notification settings - Fork 1
/
Easyb.cpp
2225 lines (2013 loc) · 76.3 KB
/
Easyb.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//----------------------------------------------------------------------------------------
//
// This file and all other Easy Bridge source files are copyright (C) 2002 by Steven Han.
// Use of this file is governed by the GNU General Public License.
// See the files COPYING and COPYRIGHT for details.
//
//----------------------------------------------------------------------------------------
//
// EasyB.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "EasyB.h"
#include "mainfrm.h"
#include "EasyBdoc.h"
#include "EasyBvw.h"
#include "Player.h"
#include "progopts.h"
#include "playeropts.h"
#include "bidopts.h"
#include "bidparams.h"
#include "dealparm.h"
#include "ConventionSet.h"
#include "deck.h"
#include "card.h"
#include "SplashWnd.h"
#include "GIB.h"
//#include "NeuralNet.h"
#include "play.h"
#include <mmsystem.h>
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
// default order in which suits get displayed, left to right
const int defSuitDisplaySequence[5][4] = {
{ SPADES, HEARTS, CLUBS, DIAMONDS },
{ SPADES, HEARTS, DIAMONDS, CLUBS },
{ DIAMONDS, CLUBS, HEARTS, SPADES },
{ CLUBS, DIAMONDS, HEARTS, SPADES },
{ HEARTS, SPADES, DIAMONDS, CLUBS },
};
const int tnumSuitSequences = sizeof(defSuitDisplaySequence) / sizeof(int[4]);
const LPCTSTR szPosition[4] = { "South", "West", "North", "East" };
//const LPCTSTR tszAppAboutWAVFile = _T("Ocean.wav");
// default counting options
const int tnDefaultAceValue = 4;
const int tnDefaultKingValue = 3;
const int tnDefaultQueenValue = 2;
const int tnDefaultJackValue = 1;
LPCTSTR tszDefaultAceValue = _T("4");
LPCTSTR tszDefaultKingValue = _T("3");
LPCTSTR tszDefaultQueenValue = _T("2");
LPCTSTR tszDefaultJackValue = _T("1");
//
const double tfGinsburgAceValue = 4.5;
const double tfGinsburgKingValue = 3.0;
const double tfGinsburgQueenValue = 1.5;
const double tfGinsburgJackValue = 0.8;
// global pointer to the current convention set
CConventionSet* pCurrConvSet = NULL;
// neural net settings
const int tnumNNetInputs = 350;
//const int tnumNNetOutputs = 38;
const int tnumNNetOutputs = 608;
const int tnumNNetHiddenLayers = 1;
const int tnumNNetNodesPerHiddenLayer = 100;
//
const double c_tfDefaultMajorSuitGamePts = 26;
const double c_tfDefaultMinorSuitGamePts = 29;
const double c_tfDefaultNTGamePts = 26;
const double c_tfDefault4LevelPts = 26;
const double c_tfDefault3LevelPts = 23;
const double c_tfDefault2LevelPts = 20;
const double c_tfDefaultSlamPts = 33;
const double c_tfDefaultGrandSlamPts = 37;
// static data
double CEasyBApp::m_fDefaultMajorSuitGamePts = c_tfDefaultMajorSuitGamePts;
double CEasyBApp::m_fDefaultMinorSuitGamePts = c_tfDefaultMinorSuitGamePts;
double CEasyBApp::m_fDefaultNTGamePts = c_tfDefaultNTGamePts;
double CEasyBApp::m_fDefault4LevelPts = c_tfDefault4LevelPts;
double CEasyBApp::m_fDefault3LevelPts = c_tfDefault3LevelPts;
double CEasyBApp::m_fDefault2LevelPts = c_tfDefault2LevelPts;
double CEasyBApp::m_fDefaultSlamPts = c_tfDefaultSlamPts;
double CEasyBApp::m_fDefaultGrandSlamPts = c_tfDefaultGrandSlamPts;
//
double CEasyBApp::m_fMajorSuitGamePts = c_tfDefaultMajorSuitGamePts;
double CEasyBApp::m_fMinorSuitGamePts = c_tfDefaultMinorSuitGamePts;
double CEasyBApp::m_fNTGamePts = c_tfDefaultNTGamePts;
double CEasyBApp::m_f4LevelPts = c_tfDefault4LevelPts;
double CEasyBApp::m_f3LevelPts = c_tfDefault3LevelPts;
double CEasyBApp::m_f2LevelPts = c_tfDefault2LevelPts;
double CEasyBApp::m_fSlamPts = c_tfDefaultSlamPts;
double CEasyBApp::m_fGrandSlamPts = c_tfDefaultGrandSlamPts;
double CEasyBApp::m_fHonorValue[] = {
// 0 1 2 3 4 5 6 7 8 9 T J Q K A
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
/////////////////////////////////////////////////////////////////////////////
//
// Global Variables
//
/////////////////////////////////////////////////////////////////////////////
//
CEasyBApp theApp;
CConventionSet* pConventionSet[100];
/////////////////////////////////////////////////////////////////////////////
// CEasyBApp
BEGIN_MESSAGE_MAP(CEasyBApp, CWinApp)
//{{AFX_MSG_MAP(CEasyBApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
// ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CEasyBApp construction
CEasyBApp::CEasyBApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
// display options
static TCHAR BASED_CODE szDisplayOptions[] = _T("Display Options");
static TCHAR BASED_CODE szSuitSequence[] = _T("Suit Display Order");
static TCHAR BASED_CODE szLowResOption[] = _T("Low Resolution Option");
static TCHAR BASED_CODE szLayoutFollowsDisplayOrder[] = _T("Card Layout Dialog follows Display Suit Order");
static TCHAR BASED_CODE szShowDummyTrumpsOnLeft[] = _T("Show Dummy Trumps on Left");
static TCHAR BASED_CODE szShowStartupAnimation[] = _T("Show Startup Animation");
static TCHAR BASED_CODE szShowSplashWindow[] = _T("Show Splash Window");
static TCHAR BASED_CODE szShowDailyTips[] = _T("Show Tip of the Day");
static TCHAR BASED_CODE szShowScreenSizeWarning[] = _T("Show Screen Size Warning");
static TCHAR BASED_CODE szShowBackgroundBitmap[] = _T("Show Background Bitmap Display");
static TCHAR BASED_CODE szBitmapDisplayMode[] = _T("Background Bitmap Display Mode (0=Tile, 1=Center)");
static TCHAR BASED_CODE szScaleLargeBitmaps[] = _T("Scale Large Background Bitmaps");
static TCHAR BASED_CODE szBackgroundColor[] = _T("Window Background Color");
static TCHAR BASED_CODE szUseSuitSymbols[] = _T("Use Suit Symbols Instead of Letters");
static TCHAR BASED_CODE szShowLayoutOnEdit[] = _T("Automatically Show Card Layout Dialog When Editing Existing Hands");
static TCHAR BASED_CODE szCollapseGameReviewDialog[] = _T("Hide tags list in Game Review dialog");
// game options
static TCHAR BASED_CODE szGameOptions[] = _T("Game Options");
static TCHAR BASED_CODE szAutoBidStart[] = _T("Auto Start Bidding after Deal");
static TCHAR BASED_CODE szEnableAnalysisTracing[] = _T("Enable Computer Player Analysis Tracing");
static TCHAR BASED_CODE szEnableAnalysisDuringHints[] = _T("Enable Analysis Tracing When Obtaining Hints");
static TCHAR BASED_CODE szAutoHintMode[] = _T("Auto Hint Level");
static TCHAR BASED_CODE szAutoHintTraceLevel[] = _T("Auto Hint Trace Level");
static TCHAR BASED_CODE szAnalysisTraceLevel[] = _T("Computer Player Analysis Trace Level");
//static TCHAR BASED_CODE szShowCommentIdentifiers[] = _T("Suppress Comment Identifier Codes");
static TCHAR BASED_CODE szShowCommentIdentifiers[] = _T("Show Comment Identifier Codes");
static TCHAR BASED_CODE szInsertBiddingPause[] = _T("Insert Pause between Bids");
static TCHAR BASED_CODE szBiddingPauseLength[] = _T("Pause Length between Bids (tenths of a second)");
static TCHAR BASED_CODE szInsertPlayPause[] = _T("Insert Pause between Plays");
static TCHAR BASED_CODE szPlayPauseLength[] = _T("Pause Length between Plays (tenths of a second)");
static TCHAR BASED_CODE szComputerCanClaim[] = _T("Computer Player Can Claim Remaining Tricks");
static TCHAR BASED_CODE szShowPassedHands[] = _T("Show All Four Hands When a Hand Is Passed Out");
static TCHAR BASED_CODE szAllowRebidPassedHands[] = _T("Allow Rebid On a Passed Hand");
static TCHAR BASED_CODE szPassedHandWaitInterval[] = _T("Time to Wait After Passed Hand to Deal New Hand");
static TCHAR BASED_CODE szAutoShowBidHistory[] = _T("Automatically Show Bid History When Biddding");
static TCHAR BASED_CODE szAutoShowPlayHistory[] = _T("Automatically Show Play History During Play");
static TCHAR BASED_CODE szAutoHideBidHistory[] = _T("Automatically Hide Bid History During Play");
static TCHAR BASED_CODE szAutoHidePlayHistory[] = _T("Automatically Hide Play History When Bidding");
//static TCHAR BASED_CODE szAutoShowNNetOutputWhenTraining[] = _T("Automatically show Neural Net Output Dialog When in Training Mode");
static TCHAR BASED_CODE szPlayMode[] = _T("Game Play Mode");
static TCHAR BASED_CODE szPlayModeLocked[] = _T("Game Play Mode Locked");
static TCHAR BASED_CODE szAutoJumpCursor[] = _T("Automatically Jump the Cursor");
static TCHAR BASED_CODE szAutoPlayLastCard[] = _T("Automatically play the last card in the suit led");
static TCHAR BASED_CODE szEnableSpokenBids[] = _T("Enable Spoken Bids");
static TCHAR BASED_CODE szSaveIntermediatePositions[] = _T("Save Intermediate Positions When Saving Hands");
static TCHAR BASED_CODE szExposePBNGameCards[] = _T("Expose All Cards When a PBN Game Is Loaded");
// GIB options
static TCHAR BASED_CODE szGIBOptions[] = _T("GIB Options");
static TCHAR BASED_CODE szGIBPath[] = _T("GIB Executable Path");
static TCHAR BASED_CODE szEnableGIBForDeclarer[] = _T("Enable GIB for Declarer Play");
static TCHAR BASED_CODE szEnableGIBForDefender[] = _T("Enable GIB for Defender Play");
static TCHAR BASED_CODE szGIBAnalysisTime[] = _T("GIB Max Analysis Time");
static TCHAR BASED_CODE szGIBSampleSize[] = _T("GIB Monte Carlo Deal Sample Size");
static TCHAR BASED_CODE szShowGIBOutput[] = _T("Show GIB Program Output");
// counting options
static TCHAR BASED_CODE szCountingOptions[] = _T("Counting Options");
static TCHAR BASED_CODE szAggressivenessRating[] = _T("Bidding Aggressiveness Rating (-2 to + 2)");
static TCHAR BASED_CODE szHonorsValuationMode[] = _T("Honors Valuation Mode");
static TCHAR BASED_CODE szCustomAceValue[] = _T("Custom Value of an Ace");
static TCHAR BASED_CODE szCustomKingValue[] = _T("Custom value of a King");
static TCHAR BASED_CODE szCustomQueenValue[] = _T("Custom value of a Queen");
static TCHAR BASED_CODE szCustomJackValue[] = _T("Custom value of a Jack");
static TCHAR BASED_CODE szMajorSuitGamePts[] = _T("Default Points needed for Game in a Major Suit");
static TCHAR BASED_CODE szMinorSuitGamePts[] = _T("Default Points needed for Game in a Minor Suit");
static TCHAR BASED_CODE szNTGamePts[] = _T("Default Points needed for Game in No Trump");
static TCHAR BASED_CODE sz4LevelPts[] = _T("Default Points needed for a Level 4 Countract");
static TCHAR BASED_CODE sz3LevelPts[] = _T("Default Points needed for a Level 3 Countract");
static TCHAR BASED_CODE sz2LevelPts[] = _T("Default Points needed for a Level 2 Countract");
static TCHAR BASED_CODE szSlamPts[] = _T("Default Points needed for a Small Slam bid");
static TCHAR BASED_CODE szGrandSlamPts[] = _T("Default Points needed for a Grand Slam bid");
static TCHAR BASED_CODE szAcelessPenalty[] = _T("Deduct 1 pt for Aceless Hand");
static TCHAR BASED_CODE sz4AceBonus[] = _T("Add 1 pt for Holding All 4 Aces");
static TCHAR BASED_CODE szPenalizeUGHonors[] = _T("Penalize Unguarded/Poorly Guarded Honors");
static TCHAR BASED_CODE szCountShortSuits[] = _T("Count Points for Short Suits When Opening");
// deal options
static TCHAR BASED_CODE szDealOptions[] = _T("Deal Options");
static TCHAR BASED_CODE szMinGamePts[] = _T("Min Points for Game Hand");
static TCHAR BASED_CODE szMaxGamePts[] = _T("Max Points for Game Hand");
static TCHAR BASED_CODE szMinMinorGamePts[] = _T("Min Points for Minor Game Hand");
static TCHAR BASED_CODE szMaxMinorGamePts[] = _T("Max Points for Minor Game Hand");
static TCHAR BASED_CODE szMinMajorGamePts[] = _T("Min Points for Major Game Hand");
static TCHAR BASED_CODE szMaxMajorGamePts[] = _T("Max Points for Major Game Hand");
static TCHAR BASED_CODE szMinNoTrumpGamePts[] = _T("Min Points for No Trump Game Hand");
static TCHAR BASED_CODE szMaxNoTrumpGamePts[] = _T("Max Points for No Trump Game Hand");
static TCHAR BASED_CODE szMinSlamPts[] = _T("Min Points for Slam Hand");
static TCHAR BASED_CODE szMaxSlamPts[] = _T("Max Points for Slam Hand");
static TCHAR BASED_CODE szMinSmallSlamPts[] = _T("Min Points for Small Slam Hand");
static TCHAR BASED_CODE szMaxSmallSlamPts[] = _T("Max Points for Small Slam Hand");
static TCHAR BASED_CODE szMinGrandSlamPts[] = _T("Min Points for Grand Slam Hand");
static TCHAR BASED_CODE szMaxGrandSlamPts[] = _T("Max Points for Grand Slam Hand");
static TCHAR BASED_CODE szBalanceTeamHands[] = _T("Try to Balance Partnership Hands Points");
static TCHAR BASED_CODE szMinCardsInMajor[] = _T("Min # Cards in Major Suit");
static TCHAR BASED_CODE szMinCardsInMinor[] = _T("Min # Cards in Minor Suit");
static TCHAR BASED_CODE szMinSuitDistMinor[] = _T("Min Distribution for Minor Suit");
static TCHAR BASED_CODE szMinSuitDistMajor[] = _T("Min Distribution for Major Suit");
static TCHAR BASED_CODE szMinTopMajorCard[] = _T("Min Top Cards in Major Suit");
static TCHAR BASED_CODE szMinTopMinorCard[] = _T("Min Top Cards in Minor Suit");
static TCHAR BASED_CODE szMaxImbalanceForNT[] = _T("Max Imbalance for NT Game");
static TCHAR BASED_CODE szNeedTwoBalancedHandsForNT[] = _T("Need 2 Balanced Hands for NT Game");
static TCHAR BASED_CODE szAcesNeededForSlam[] = _T("Number of Aces to Deal for Slam Hand");
static TCHAR BASED_CODE szAcesNeededForSmallSlam[] = _T("Min Number of Aces to Deal for Small Slam Hand");
static TCHAR BASED_CODE szAcesNeededForGrandSlam[] = _T("Min Number of Aces to Deal for Grand Slam Hand");
static TCHAR BASED_CODE szKingsNeededForSlam[] = _T("Min Number of Kings to Deal for Slam Hand");
static TCHAR BASED_CODE szKingsNeededForSmallSlam[] = _T("Min Number of Kings to Deal for Small Slam Hand");
static TCHAR BASED_CODE szKingsNeededForGrandSlam[] = _T("Min Number of Kings to Deal for Grand Slam Hand");
static TCHAR BASED_CODE szEnableDealNumbering[] = _T("Enable Deal Numbering and Recall");
// scoring options
static TCHAR BASED_CODE szScoringOptions[] = _T("Scoring Options");
static TCHAR BASED_CODE szUseDuplicateScoring[] = _T("Use Duplicate Scoring");
static TCHAR BASED_CODE szScoreHonorsBonuses[] = _T("Score Honors Bonuses");
// convention settings
static TCHAR BASED_CODE szCurrConventionSet[] = _T("Current Convention Set");
// bidding config
static TCHAR BASED_CODE szBiddingConfigOptions[] = _T("Bidding Configuration");
//static TCHAR BASED_CODE szBiddingEngine[] = _T("Bidding Engine (0 = Rule-Based, 1 = Neural Net)");
static TCHAR BASED_CODE szBiddingAggressiveness[] = _T("Bidding Aggressiveness (-2 to +2)");
/*
static TCHAR BASED_CODE szNumNNetHiddenLayers[] = _T("Default Neural Hidden Layers");
static TCHAR BASED_CODE szNumNNetNodesPerHiddenLayer[] = _T("Default Neural Nodes Per Hidden Layer");
static TCHAR BASED_CODE szNeuralNetFile[] = _T("Nueral Net File");
*/
// play options
static TCHAR BASED_CODE szPlayOptions[] = _T("Game Play Options");
// debug options
static TCHAR BASED_CODE szDebugOptions[] = _T("Debug Options");
static TCHAR BASED_CODE szEnableDebugMode[] = _T("Enable Debug Mode");
static TCHAR BASED_CODE szExposeAllCards[] = _T("Expose All Cards");
//
void CEasyBApp::Initialize()
{
// read in display options
m_nSuitSeqOption = GetProfileInt(szDisplayOptions, szSuitSequence, 0);
m_bLayoutFollowsDisplayOrder = GetProfileInt(szDisplayOptions, szLayoutFollowsDisplayOrder, TRUE);
m_bLowResOption = GetProfileInt(szDisplayOptions, szLowResOption, FALSE);
m_bShowDummyTrumpsOnLeft = GetProfileInt(szDisplayOptions, szShowDummyTrumpsOnLeft, TRUE);
m_bShowStartupAnimation = GetProfileInt(szDisplayOptions, szShowStartupAnimation, FALSE);
m_bShowSplashWindow = GetProfileInt(szDisplayOptions, szShowSplashWindow, TRUE);
m_bShowDailyTipDialog = GetProfileInt(szDisplayOptions, szShowDailyTips, TRUE);
m_bShowScreenSizeWarning = GetProfileInt(szDisplayOptions, szShowScreenSizeWarning, TRUE);
m_bShowBackgroundBitmap = GetProfileInt(szDisplayOptions, szShowBackgroundBitmap, TRUE);
m_nBitmapDisplayMode = GetProfileInt(szDisplayOptions, szBitmapDisplayMode, 1);
m_bScaleLargeBitmaps = GetProfileInt(szDisplayOptions, szScaleLargeBitmaps, FALSE);
m_nBackgroundColor = GetProfileInt(szDisplayOptions, szBackgroundColor, RGB(0,128,0));
m_bUseSuitSymbols = GetProfileInt(szDisplayOptions, szUseSuitSymbols, FALSE);
m_bShowLayoutOnEdit = GetProfileInt(szDisplayOptions, szShowLayoutOnEdit, FALSE);
m_bCollapseGameReviewDialog = GetProfileInt(szDisplayOptions, szCollapseGameReviewDialog, FALSE);
// read in game options
m_bAutoBidStart = GetProfileInt(szGameOptions, szAutoBidStart, TRUE);
m_bEnableAnalysisTracing = GetProfileInt(szGameOptions, szEnableAnalysisTracing, FALSE);
m_bEnableAnalysisDuringHints = GetProfileInt(szGameOptions, szEnableAnalysisDuringHints, TRUE);
m_nAnalysisTraceLevel = GetProfileInt(szGameOptions, szAnalysisTraceLevel, 3);
#ifdef _DEBUG
m_bShowCommentIdentifiers = GetProfileInt(szGameOptions, szShowCommentIdentifiers, TRUE);
#else
m_bShowCommentIdentifiers = GetProfileInt(szGameOptions, szShowCommentIdentifiers, FALSE);
#endif
m_nAutoHintMode = GetProfileInt(szGameOptions, szAutoHintMode, 0);
m_nAutoHintTraceLevel = GetProfileInt(szGameOptions, szAutoHintTraceLevel, 2);
m_bInsertBiddingPause = GetProfileInt(szGameOptions, szInsertBiddingPause, TRUE);
m_nBiddingPauseLength = GetProfileInt(szGameOptions, szBiddingPauseLength, 3);
m_bInsertPlayPause = GetProfileInt(szGameOptions, szInsertPlayPause, TRUE);
m_nPlayPauseLength = GetProfileInt(szGameOptions, szPlayPauseLength, 10);
m_bComputerCanClaim = GetProfileInt(szGameOptions, szComputerCanClaim, FALSE);
m_bShowPassedHands = GetProfileInt(szGameOptions, szShowPassedHands, TRUE);
m_bAllowRebidPassedHands = GetProfileInt(szGameOptions, szAllowRebidPassedHands, FALSE);
m_nPassedHandWaitInterval = GetProfileInt(szGameOptions, szPassedHandWaitInterval, 1100);
m_bAutoShowBidHistory = GetProfileInt(szGameOptions, szAutoShowBidHistory, TRUE);
m_bAutoShowPlayHistory = GetProfileInt(szGameOptions, szAutoShowPlayHistory, TRUE);
m_bAutoHideBidHistory = GetProfileInt(szGameOptions, szAutoHideBidHistory, FALSE);
m_bAutoHidePlayHistory = GetProfileInt(szGameOptions, szAutoHidePlayHistory, FALSE);
// m_bAutoShowNNetOutputWhenTraining = GetProfileInt(szGameOptions, szAutoShowNNetOutputWhenTraining, TRUE);
m_bAutoJumpCursor = GetProfileInt(szGameOptions, szAutoJumpCursor, FALSE);
m_bAutoPlayLastCard = GetProfileInt(szGameOptions, szAutoPlayLastCard, TRUE);
// m_bEnableSpokenBids = GetProfileInt(szGameOptions, szEnableSpokenBids, FALSE);
m_bSaveIntermediatePositions = GetProfileInt(szGameOptions, szSaveIntermediatePositions, TRUE);
m_bExposePBNGameCards = GetProfileInt(szGameOptions, szExposePBNGameCards, TRUE);
#ifdef _DEBUG
m_nPlayMode = GetProfileInt(szGameOptions, szPlayMode, PLAY_NORMAL);
m_bPlayModeLocked = GetProfileInt(szGameOptions, szPlayModeLocked, FALSE);
#else
m_nPlayMode = m_bPlayModeLocked = FALSE;
#endif
// counting parameters
m_nHonorsValuationMode = GetProfileInt(szCountingOptions, szHonorsValuationMode, 0);
m_fCustomAceValue = atof(GetProfileString(szCountingOptions, szCustomAceValue, tszDefaultAceValue));
m_fCustomKingValue = atof(GetProfileString(szCountingOptions, szCustomKingValue, tszDefaultKingValue));
m_fCustomQueenValue = atof(GetProfileString(szCountingOptions, szCustomQueenValue, tszDefaultQueenValue));
m_fCustomJackValue = atof(GetProfileString(szCountingOptions, szCustomJackValue, tszDefaultJackValue));
m_fDefaultMajorSuitGamePts = atof(GetProfileString(szCountingOptions, szMajorSuitGamePts, FormString("%f", c_tfDefaultMajorSuitGamePts)));
m_fDefaultMinorSuitGamePts = atof(GetProfileString(szCountingOptions, szMinorSuitGamePts, FormString("%f", c_tfDefaultMinorSuitGamePts)));
m_fDefaultNTGamePts = atof(GetProfileString(szCountingOptions, szNTGamePts, FormString("%f", c_tfDefaultNTGamePts)));
m_fDefault4LevelPts = atof(GetProfileString(szCountingOptions, sz4LevelPts, FormString("%f", c_tfDefault4LevelPts)));
m_fDefault3LevelPts = atof(GetProfileString(szCountingOptions, sz3LevelPts, FormString("%f", c_tfDefault3LevelPts)));
m_fDefault2LevelPts = atof(GetProfileString(szCountingOptions, sz2LevelPts, FormString("%f", c_tfDefault2LevelPts)));
m_fDefaultSlamPts = atof(GetProfileString(szCountingOptions, szSlamPts, FormString("%f", c_tfDefaultSlamPts)));
m_fDefaultGrandSlamPts = atof(GetProfileString(szCountingOptions, szGrandSlamPts, FormString("%f", c_tfDefaultGrandSlamPts)));
/*
m_bAcelessPenalty = GetProfileInt(szCountingOptions, szAcelessPenalty, TRUE);
m_b4AceBonus = GetProfileInt(szCountingOptions, sz4AceBonus, TRUE);
m_bPenalizeUGHonors = GetProfileInt(szCountingOptions, szPenalizeUGHonors, FALSE);
m_bCountShortSuits = GetProfileInt(szCountingOptions, szCountShortSuits, TRUE);
*/
m_bAcelessPenalty = TRUE;
m_b4AceBonus = TRUE;
m_bPenalizeUGHonors = TRUE;
m_bCountShortSuits = TRUE;
// get GIB options
m_strGIBPath = GetProfileString(szGIBOptions, szGIBPath, "C:\\");
m_bEnableGIBForDeclarer = GetProfileInt(szGIBOptions, szEnableGIBForDeclarer, FALSE);
// m_bEnableGIBForDefender = GetProfileInt(szGIBOptions, szEnableGIBForDefender, FALSE);
m_bEnableGIBForDefender = FALSE;
m_nGIBAnalysisTime = GetProfileInt(szGIBOptions, szGIBAnalysisTime, 30);
m_nGIBSampleSize = GetProfileInt(szGIBOptions, szGIBSampleSize, 100);
m_bShowGIBOutput = GetProfileInt(szGIBOptions, szShowGIBOutput, FALSE);
// m_nCurrConventionSet = GetProfileInt(szBiddingConventions, szCurrConvSet, 0);
m_nCurrConventionSet = 0;
// get deal options
m_nReqPointsGame[0][0] = GetProfileInt(szDealOptions, szMinGamePts, nDefReqPointsGame[0][0]);
m_nReqPointsGame[0][1] = GetProfileInt(szDealOptions, szMaxGamePts, nDefReqPointsGame[0][1]);
m_nReqPointsGame[1][0] = GetProfileInt(szDealOptions, szMinMinorGamePts, nDefReqPointsGame[1][0]);
m_nReqPointsGame[1][1] = GetProfileInt(szDealOptions, szMaxMinorGamePts, nDefReqPointsGame[1][1]);
m_nReqPointsGame[2][0] = GetProfileInt(szDealOptions, szMinMajorGamePts, nDefReqPointsGame[2][0]);
m_nReqPointsGame[2][1] = GetProfileInt(szDealOptions, szMaxMajorGamePts, nDefReqPointsGame[2][1]);
m_nReqPointsGame[3][0] = GetProfileInt(szDealOptions, szMinNoTrumpGamePts, nDefReqPointsGame[3][0]);
m_nReqPointsGame[3][1] = GetProfileInt(szDealOptions, szMaxNoTrumpGamePts, nDefReqPointsGame[3][1]);
m_nReqPointsSlam[0][0] = GetProfileInt(szDealOptions, szMinSlamPts, nDefReqPointsSlam[0][0]);
m_nReqPointsSlam[0][1] = GetProfileInt(szDealOptions, szMaxSlamPts, nDefReqPointsSlam[0][1]);
m_nReqPointsSlam[1][0] = GetProfileInt(szDealOptions, szMinSmallSlamPts, nDefReqPointsSlam[1][0]);
m_nReqPointsSlam[1][1] = GetProfileInt(szDealOptions, szMaxSmallSlamPts, nDefReqPointsSlam[1][1]);
m_nReqPointsSlam[2][0] = GetProfileInt(szDealOptions, szMinGrandSlamPts, nDefReqPointsSlam[2][0]);
m_nReqPointsSlam[2][1] = GetProfileInt(szDealOptions, szMaxGrandSlamPts, nDefReqPointsSlam[2][1]);
m_bBalanceTeamHands = GetProfileInt(szDealOptions, szBalanceTeamHands, bDefBalanceTeamHands);
//
m_nMinCardsInMajor = GetProfileInt(szDealOptions, szMinCardsInMajor, nDefMinCardsInMajor);
m_nMinCardsInMinor = GetProfileInt(szDealOptions, szMinCardsInMinor, nDefMinCardsInMinor);
m_nMinSuitDist[0] = GetProfileInt(szDealOptions, szMinSuitDistMinor, nDefMinSuitDist[0]);
m_nMinSuitDist[1] = GetProfileInt(szDealOptions, szMinSuitDistMajor, nDefMinSuitDist[1]);
m_nMinTopMajorCard = GetProfileInt(szDealOptions, szMinTopMajorCard, nDefMinTopMajorCard);
m_nMinTopMinorCard = GetProfileInt(szDealOptions, szMinTopMinorCard, nDefMinTopMinorCard);
// m_nMaxImbalanceForNT = GetProfileInt(szDealOptions, szMaxImbalanceForNT, nDefMaxBalancedForNT);
m_nMaxImbalanceForNT = nDefMaxBalancedForNT;
m_bNeedTwoBalancedTrumpHands = GetProfileInt(szDealOptions, szNeedTwoBalancedHandsForNT, bDefNeedTwoBalancedTrumpHands);
m_numAcesForSlam[0] = GetProfileInt(szDealOptions, szAcesNeededForSlam, nDefNumAcesForSlam[0]);
m_numAcesForSlam[1] = GetProfileInt(szDealOptions, szAcesNeededForSmallSlam, nDefNumAcesForSlam[1]);
m_numAcesForSlam[2] = GetProfileInt(szDealOptions, szAcesNeededForGrandSlam, nDefNumAcesForSlam[2]);
m_numKingsForSlam[0] = GetProfileInt(szDealOptions, szAcesNeededForSlam, nDefNumKingsForSlam[0]);
m_numKingsForSlam[1] = GetProfileInt(szDealOptions, szAcesNeededForSmallSlam, nDefNumKingsForSlam[1]);
m_numKingsForSlam[2] = GetProfileInt(szDealOptions, szAcesNeededForGrandSlam, nDefNumKingsForSlam[2]);
m_bEnableDealNumbering = GetProfileInt(szDealOptions, szEnableDealNumbering, TRUE);
// get scoring options
m_bDuplicateScoring = GetProfileInt(szScoringOptions, szUseDuplicateScoring, FALSE);
m_bScoreHonorsBonuses = GetProfileInt(szScoringOptions, szScoreHonorsBonuses, FALSE);
// get bidding config options
m_fBiddingAggressiveness = atof(GetProfileString(szBiddingConfigOptions, szBiddingAggressiveness, 0));
/*
m_nBiddingEngine = GetProfileInt(szBiddingConfigOptions, szBiddingEngine, 0);
m_numNNetHiddenLayers = GetProfileInt(szBiddingConfigOptions, szNumNNetHiddenLayers, tnumNNetHiddenLayers);
m_numNNetNodesPerHiddenLayer = GetProfileInt(szBiddingConfigOptions, szNumNNetNodesPerHiddenLayer, tnumNNetNodesPerHiddenLayer);
m_strNeuralNetFile = GetProfileString(szBiddingConfigOptions, szNeuralNetFile, _T(""));
*/
// get debug options
m_bDebugMode = GetProfileInt(szDebugOptions, szEnableDebugMode, TRUE);
m_bShowCardsFaceUp = GetProfileInt(szDebugOptions, szExposeAllCards, FALSE);
}
//
void CEasyBApp::Terminate()
{
// read in display options
WriteProfileInt(szDisplayOptions, szSuitSequence, m_nSuitSeqOption);
WriteProfileInt(szDisplayOptions, szLayoutFollowsDisplayOrder, m_bLayoutFollowsDisplayOrder);
WriteProfileInt(szDisplayOptions, szLowResOption, m_bToggleResolutionMode? !m_bLowResOption : m_bLowResOption);
WriteProfileInt(szDisplayOptions, szShowDummyTrumpsOnLeft, m_bShowDummyTrumpsOnLeft);
WriteProfileInt(szDisplayOptions, szShowStartupAnimation, m_bShowStartupAnimation);
WriteProfileInt(szDisplayOptions, szShowSplashWindow, m_bShowSplashWindow);
WriteProfileInt(szDisplayOptions, szShowDailyTips, m_bShowDailyTipDialog);
WriteProfileInt(szDisplayOptions, szShowScreenSizeWarning, m_bShowScreenSizeWarning);
WriteProfileInt(szDisplayOptions, szShowBackgroundBitmap, m_bShowBackgroundBitmap);
WriteProfileInt(szDisplayOptions, szBitmapDisplayMode, m_nBitmapDisplayMode);
WriteProfileInt(szDisplayOptions, szScaleLargeBitmaps, m_bScaleLargeBitmaps);
WriteProfileInt(szDisplayOptions, szBackgroundColor, m_nBackgroundColor);
WriteProfileInt(szDisplayOptions, szUseSuitSymbols, m_bUseSuitSymbols);
WriteProfileInt(szDisplayOptions, szShowLayoutOnEdit, m_bShowLayoutOnEdit);
WriteProfileInt(szDisplayOptions, szCollapseGameReviewDialog, m_bCollapseGameReviewDialog);
// write out game options
WriteProfileInt(szGameOptions, szAutoBidStart, m_bAutoBidStart);
WriteProfileInt(szGameOptions, szEnableAnalysisTracing, m_bEnableAnalysisTracing);
WriteProfileInt(szGameOptions, szEnableAnalysisDuringHints, m_bEnableAnalysisDuringHints);
WriteProfileInt(szGameOptions, szAutoHintMode, m_nAutoHintMode);
WriteProfileInt(szGameOptions, szAutoHintTraceLevel, m_nAutoHintTraceLevel);
WriteProfileInt(szGameOptions, szAnalysisTraceLevel, m_nAnalysisTraceLevel);
WriteProfileInt(szGameOptions, szShowCommentIdentifiers, m_bShowCommentIdentifiers);
WriteProfileInt(szGameOptions, szInsertBiddingPause, m_bInsertBiddingPause);
WriteProfileInt(szGameOptions, szBiddingPauseLength, m_nBiddingPauseLength);
WriteProfileInt(szGameOptions, szInsertPlayPause, m_bInsertPlayPause);
WriteProfileInt(szGameOptions, szPlayPauseLength, m_nPlayPauseLength);
WriteProfileInt(szGameOptions, szComputerCanClaim, m_bComputerCanClaim);
WriteProfileInt(szGameOptions, szShowPassedHands, m_bShowPassedHands);
WriteProfileInt(szGameOptions, szAllowRebidPassedHands, m_bAllowRebidPassedHands);
WriteProfileInt(szGameOptions, szPassedHandWaitInterval, m_nPassedHandWaitInterval);
WriteProfileInt(szGameOptions, szAutoShowBidHistory, m_bAutoShowBidHistory);
WriteProfileInt(szGameOptions, szAutoShowPlayHistory, m_bAutoShowPlayHistory);
WriteProfileInt(szGameOptions, szAutoHideBidHistory, m_bAutoHideBidHistory);
WriteProfileInt(szGameOptions, szAutoHidePlayHistory, m_bAutoHidePlayHistory);
// WriteProfileInt(szGameOptions, szAutoShowNNetOutputWhenTraining, m_bAutoShowNNetOutputWhenTraining);
WriteProfileInt(szGameOptions, szAutoJumpCursor, m_bAutoJumpCursor);
WriteProfileInt(szGameOptions, szAutoPlayLastCard, m_bAutoPlayLastCard);
// WriteProfileInt(szGameOptions, szEnableSpokenBids, m_bEnableSpokenBids);
WriteProfileInt(szGameOptions, szSaveIntermediatePositions, m_bSaveIntermediatePositions);
WriteProfileInt(szGameOptions, szExposePBNGameCards, m_bExposePBNGameCards);
#ifdef _DEBUG
WriteProfileInt(szGameOptions, szPlayMode, m_nPlayMode);
WriteProfileInt(szGameOptions, szPlayModeLocked, m_bPlayModeLocked);
#endif
// write out counting parameters
WriteProfileInt(szCountingOptions, szHonorsValuationMode, m_nHonorsValuationMode);
if (m_nHonorsValuationMode == 2)
{
WriteProfileString(szCountingOptions, szCustomAceValue, FormString(_T("%.4f"),m_fCustomAceValue));
WriteProfileString(szCountingOptions, szCustomKingValue, FormString(_T("%.4f"),m_fCustomKingValue));
WriteProfileString(szCountingOptions, szCustomQueenValue, FormString(_T("%.4f"),m_fCustomQueenValue));
WriteProfileString(szCountingOptions, szCustomJackValue, FormString(_T("%.4f"),m_fCustomJackValue));
}
WriteProfileString(szCountingOptions, szMajorSuitGamePts, FormString("%f", m_fDefaultMajorSuitGamePts));
WriteProfileString(szCountingOptions, szMinorSuitGamePts, FormString("%f", m_fDefaultMinorSuitGamePts));
WriteProfileString(szCountingOptions, szNTGamePts, FormString("%f", m_fDefaultNTGamePts));
WriteProfileString(szCountingOptions, sz4LevelPts, FormString("%f", m_fDefault4LevelPts));
WriteProfileString(szCountingOptions, sz3LevelPts, FormString("%f", m_fDefault3LevelPts));
WriteProfileString(szCountingOptions, sz2LevelPts, FormString("%f", m_fDefault2LevelPts));
WriteProfileString(szCountingOptions, szSlamPts, FormString("%f", m_fDefaultSlamPts));
WriteProfileString(szCountingOptions, szGrandSlamPts, FormString("%f", m_fDefaultGrandSlamPts));
/*
WriteProfileInt(szCountingOptions, szAcelessPenalty, m_bAcelessPenalty);
WriteProfileInt(szCountingOptions, sz4AceBonus, m_b4AceBonus);
WriteProfileInt(szCountingOptions, szPenalizeUGHonors, m_bPenalizeUGHonors);
WriteProfileInt(szCountingOptions, szCountShortSuits, m_bCountShortSuits);
*/
// write out GIB options
WriteProfileString(szGIBOptions, szGIBPath, m_strGIBPath);
WriteProfileInt(szGIBOptions, szEnableGIBForDeclarer, m_bEnableGIBForDeclarer);
// WriteProfileInt(szGIBOptions, szEnableGIBForDefender, m_bEnableGIBForDefender);
WriteProfileInt(szGIBOptions, szGIBAnalysisTime, m_nGIBAnalysisTime);
WriteProfileInt(szGIBOptions, szGIBSampleSize, m_nGIBSampleSize);
WriteProfileInt(szGIBOptions, szShowGIBOutput, m_bShowGIBOutput);
// write out deal options
WriteProfileInt(szDealOptions, szMinGamePts, m_nReqPointsGame[0][0]);
WriteProfileInt(szDealOptions, szMaxGamePts, m_nReqPointsGame[0][1]);
WriteProfileInt(szDealOptions, szMinMinorGamePts, m_nReqPointsGame[1][0]);
WriteProfileInt(szDealOptions, szMaxMinorGamePts, m_nReqPointsGame[1][1]);
WriteProfileInt(szDealOptions, szMinMajorGamePts, m_nReqPointsGame[2][0]);
WriteProfileInt(szDealOptions, szMaxMajorGamePts, m_nReqPointsGame[2][1]);
WriteProfileInt(szDealOptions, szMinNoTrumpGamePts, m_nReqPointsGame[3][0]);
WriteProfileInt(szDealOptions, szMaxNoTrumpGamePts, m_nReqPointsGame[3][1]);
WriteProfileInt(szDealOptions, szMinSlamPts, m_nReqPointsSlam[0][0]);
WriteProfileInt(szDealOptions, szMaxSlamPts, m_nReqPointsSlam[0][1]);
WriteProfileInt(szDealOptions, szMinSmallSlamPts, m_nReqPointsSlam[1][0]);
WriteProfileInt(szDealOptions, szMaxSmallSlamPts, m_nReqPointsSlam[1][1]);
WriteProfileInt(szDealOptions, szMinGrandSlamPts, m_nReqPointsSlam[2][0]);
WriteProfileInt(szDealOptions, szMaxGrandSlamPts, m_nReqPointsSlam[2][1]);
WriteProfileInt(szDealOptions, szBalanceTeamHands, m_bBalanceTeamHands);
WriteProfileInt(szDealOptions, szMinCardsInMajor, m_nMinCardsInMajor);
WriteProfileInt(szDealOptions, szMinCardsInMinor, m_nMinCardsInMinor);
WriteProfileInt(szDealOptions, szMinSuitDistMinor, m_nMinSuitDist[0]);
WriteProfileInt(szDealOptions, szMinSuitDistMajor, m_nMinSuitDist[1]);
WriteProfileInt(szDealOptions, szMinTopMajorCard, m_nMinTopMajorCard);
WriteProfileInt(szDealOptions, szMinTopMinorCard, m_nMinTopMinorCard);
// WriteProfileInt(szDealOptions, szMaxImbalanceForNT, m_nMaxImbalanceForNT);
WriteProfileInt(szDealOptions, szNeedTwoBalancedHandsForNT, m_bNeedTwoBalancedTrumpHands);
WriteProfileInt(szDealOptions, szAcesNeededForSlam, m_numAcesForSlam[0]);
WriteProfileInt(szDealOptions, szAcesNeededForSmallSlam, m_numAcesForSlam[1]);
WriteProfileInt(szDealOptions, szAcesNeededForGrandSlam, m_numAcesForSlam[2]);
WriteProfileInt(szDealOptions, szKingsNeededForSlam, m_numKingsForSlam[0]);
WriteProfileInt(szDealOptions, szKingsNeededForSmallSlam, m_numKingsForSlam[1]);
WriteProfileInt(szDealOptions, szKingsNeededForGrandSlam, m_numKingsForSlam[2]);
WriteProfileInt(szDealOptions, szEnableDealNumbering, m_bEnableDealNumbering);
// write out bidding config options
// WriteProfileInt(szBiddingConfigOptions, szBiddingEngine, m_nBiddingEngine);
WriteProfileString(szBiddingConfigOptions, szBiddingAggressiveness, FormString("%f", m_fBiddingAggressiveness));
/*
WriteProfileInt(szBiddingConfigOptions, szNumNNetHiddenLayers, m_numNNetHiddenLayers);
WriteProfileInt(szBiddingConfigOptions, szNumNNetNodesPerHiddenLayer, m_numNNetNodesPerHiddenLayer);
WriteProfileString(szBiddingConfigOptions, szNeuralNetFile, m_strNeuralNetFile );
*/
// save scoring options
WriteProfileInt(szScoringOptions, szUseDuplicateScoring, m_bDuplicateScoring);
WriteProfileInt(szScoringOptions, szScoreHonorsBonuses, m_bScoreHonorsBonuses);
//
// WriteProfileInt(szBiddingConventions, szCurrConvSet, m_nCurrConvSet);
// write out play options
// write out debug options
// get debug options
WriteProfileInt(szDebugOptions, szEnableDebugMode, m_bDebugMode);
WriteProfileInt(szDebugOptions, szExposeAllCards, m_bShowCardsFaceUp);
}
//
// GetProgramOption() and SetProgramOption() are
// generic property get/set routines
//
//
LPVOID CEasyBApp::GetValuePV(int nItem, int nIndex1, int nIndex2, int nIndex3)
{
switch(nItem)
{
case tbAutoBidStart:
return (LPVOID) m_bAutoBidStart;
case tbAutoJumpCursor:
return (LPVOID) m_bAutoJumpCursor;
case tbAutoPlayLastCard:
return (LPVOID) m_bAutoPlayLastCard;
case tbAutoShowBidHistory:
return (LPVOID) m_bAutoShowBidHistory;
case tbAutoShowPlayHistory:
return (LPVOID) m_bAutoShowPlayHistory;
case tbAutoHideBidHistory:
return (LPVOID) m_bAutoHideBidHistory;
case tbAutoHidePlayHistory:
return (LPVOID) m_bAutoHidePlayHistory;
case tbAutoShowNNetOutputWhenTraining:
return (LPVOID) m_bAutoShowNNetOutputWhenTraining;
case tbCollapseGameReviewDialog:
return (LPVOID) m_bCollapseGameReviewDialog;
case tbBiddingInProgress:
return (LPVOID) m_bBiddingInProgress;
case tbGameInProgress:
return (LPVOID) m_bGameInProgress;
case tbRubberInProgress:
return (LPVOID) m_bRubberInProgress;
case tbUsingDuplicateScoring:
return (LPVOID) m_bDuplicateScoring;
break;
case tbDebugMode:
return (LPVOID) m_bDebugMode;
case tbManualBidding:
return (LPVOID) m_bManualBidding;
case tbAutoTestMode:
return (LPVOID) m_bAutoTestMode;
case tnAutoHintMode:
return (LPVOID) m_nAutoHintMode;
case tnAutoHintTraceLevel:
return (LPVOID) m_nAutoHintTraceLevel;
case tbEnableAnalysisTracing:
return (LPVOID) m_bEnableAnalysisTracing;
case tbEnableAnalysisDuringHints:
return (LPVOID) m_bEnableAnalysisDuringHints;
case tnAnalysisTraceLevel:
return (LPVOID) m_nAnalysisTraceLevel;
case tbShowCommentIdentifiers:
return (LPVOID) m_bShowCommentIdentifiers;
case tbInsertBiddingPause:
return (LPVOID) m_bInsertBiddingPause;
case tnBiddingPauseLength:
return (LPVOID) m_nBiddingPauseLength;
case tbInsertPlayPause:
return (LPVOID) m_bInsertPlayPause;
case tnPlayPauseLength:
return (LPVOID) m_nPlayPauseLength;
case tbComputerCanClaim:
return (LPVOID) m_bComputerCanClaim;
case tbShowPassedHands:
return (LPVOID) m_bShowPassedHands;
case tbAllowRebidPassedHands:
return (LPVOID) m_bAllowRebidPassedHands;
case tnPassedHandWaitInterval:
return (LPVOID) m_nPassedHandWaitInterval;
case tbManualPlayMode:
return (LPVOID) m_bManualPlayMode;
case tnCardPlayMode:
if (m_bManualPlayMode)
return (LPVOID) PLAY_MANUAL;
else
return (LPVOID) m_nPlayMode;
case tbPlayModeLocked:
return (LPVOID) m_bPlayModeLocked;
case tbShowCardsFaceUp:
return (LPVOID) m_bShowCardsFaceUp;
case tbShowLayoutOnEdit:
return (LPVOID) m_bShowLayoutOnEdit;
case tbAutoAlignDialogs:
return (LPVOID) m_bAutoAlignDialogs;
case tbShowStartupAnimation:
return (LPVOID) m_bShowStartupAnimation;
case tbShowBackgroundBitmap:
return (LPVOID) m_bShowBackgroundBitmap;
case tnBackgroundColor:
return (LPVOID) m_nBackgroundColor;
case tbUseSuitSymbols:
return (LPVOID) m_bUseSuitSymbols;
case tnBitmapDisplayMode:
return (LPVOID) m_nBitmapDisplayMode;
case tbScaleLargeBitmaps:
return (LPVOID) m_bScaleLargeBitmaps;
case tbShowSplashWindow:
return (LPVOID) m_bShowSplashWindow;
case tbEnableSpokenBids:
return (LPVOID) m_bEnableSpokenBids;
case tbSaveIntermediatePositions:
return (LPVOID) m_bSaveIntermediatePositions;
case tbExposePBNGameCards:
return (LPVOID) m_bExposePBNGameCards;
case tbShowDailyTipDialog:
return (LPVOID) m_bShowDailyTipDialog;
case tbShowScreenSizeWarning:
return (LPVOID) m_bShowScreenSizeWarning;
//
case tnWindowsBuildNumber:
return (LPVOID) m_nWinBuildNum;
case tnWindowsMajorVersion:
return (LPVOID) m_nWinMajorVer;
case tnWindowsMinorVersion:
return (LPVOID) m_nWinMinorVer;
case tbWin32:
return (LPVOID) m_bWin32;
case tnSplashTime:
return (LPVOID) m_dwSplashTime;
case tnumConventionSets:
return (LPVOID) m_numConventionSets;
case tnCurrentConventionSet:
return (LPVOID) m_nCurrConventionSet;
case tbFirstTimeRunning:
return (LPVOID) m_bFirstTimeRunning;
case tnGameMode:
return (LPVOID) m_nGameMode;
case tszProgramPath:
return (LPVOID) (LPCTSTR) m_strProgPath;
case tszProgramDirectory:
return (LPVOID) (LPCTSTR) m_strProgDirectory;
// case tszAboutDialogWAV:
// return (LPVOID) (LPCTSTR) tszAppAboutWAVFile;
case tstrProgramCopyright:
return (LPVOID) (LPCTSTR) m_strProgCopyright;
case tnProgramMajorVersion:
return (LPVOID) m_nProgMajorVersion;
case tnProgramMinorVersion:
return (LPVOID) m_nProgMinorVersion;
case tnProgramIncrementVersion:
return (LPVOID) m_nProgIncrementVersion;
case tnProgramBuildNumber:
return (LPVOID) m_nProgBuildNumber;
case tstrProgramBuildDate:
return (LPVOID) (LPCTSTR) m_strProgBuildDate;
case tstrSpecialBuildCode:
return (LPVOID) (LPCTSTR) m_strSpecialBuildCode;
case tstrProgramVersionString:
return (LPVOID) (LPCTSTR) GetProgramVersionString();
case tnSuitSequenceList:
return (LPVOID) m_nSuitSeqList[nIndex1][nIndex2];
case tnSuitSequenceOption:
return (LPVOID) m_nSuitSeqOption;
case tbLowResOption:
return (LPVOID) m_bLowResOption;
case tbToggleResolutionMode:
return (LPVOID) m_bToggleResolutionMode;
case tbLayoutFollowsDisplayOrder:
return (LPVOID) m_bLayoutFollowsDisplayOrder;
case tbShowDummyTrumpsOnLeft:
return (LPVOID) m_bShowDummyTrumpsOnLeft;
case tnSuitSequence:
return (LPVOID) m_nSuitSequence[nIndex1];
case tnDummySuitSequence:
return (LPVOID) m_nDummySuitSequence[nIndex1];
case tnWindowsSystemMode:
return (LPVOID) m_nWinMode;
case tpvActiveDocument:
return (LPVOID) m_pActiveDocument;
case tpvSplashWindow:
return (LPVOID) NULL; //
case tstrProgramTitle:
return (LPVOID) (LPCTSTR) m_strProgTitle;
case tszPlayerPosition:
return (LPVOID) szPosition[nIndex1];
case tszSuitName:
return (LPVOID) szSuitName[nIndex1];
// GIB Info
case tszGIBPath:
return (LPVOID) (LPCTSTR) m_strGIBPath;
case tbEnableGIBForDeclarer:
return (LPVOID) m_bEnableGIBForDeclarer;
case tbEnableGIBForDefender:
return (LPVOID) m_bEnableGIBForDefender;
case tnGIBAnalysisTime:
return (LPVOID) m_nGIBAnalysisTime;
case tnGIBSampleSize:
return (LPVOID) m_nGIBSampleSize;
// deal parameters
case tnRequiredPointsForGame: // [4][2]
return (LPVOID) m_nReqPointsGame[nIndex1][nIndex2];
case tnRequiredPointsForSlam: // [3][2]
return (LPVOID) m_nReqPointsSlam[nIndex1][nIndex2];
case tnPointsAbsoluteGameLimits:
return (LPVOID) m_nPointsAbsGameLimits[nIndex1][nIndex2];
case tnPointsAbsoluteSlamLimits:
return (LPVOID) m_nPointsAbsSlamLimits[nIndex1][nIndex2];
case tbBalanceTeamHands:
return (LPVOID) m_bBalanceTeamHands;
case tbGiveSouthBestHandInPartnership:
return (LPVOID) m_bGiveSouthBestHandInPartnership;
case tbGiveSouthBestHandInGame:
return (LPVOID) m_bGiveSouthBestHandInGame;
case tnMinCardsInMajor:
return (LPVOID) m_nMinCardsInMajor;
case tnMinCardsInMinor:
return (LPVOID) m_nMinCardsInMinor;
case tnMinSuitDistributionTable:
return (LPVOID) m_nMinSuitDistTable[nIndex1][nIndex2][nIndex3];
case tnMinSuitDistributions:
return (LPVOID) m_nMinSuitDist[nIndex1];
case tnMinTopMajorCard:
return (LPVOID) m_nMinTopMajorCard;
case tnMinTopMinorCard:
return (LPVOID) m_nMinTopMinorCard;
case tnMaxImbalanceForNT:
return (LPVOID) m_nMaxImbalanceForNT;
case tbNeedTwoBalancedTrumpHands:
return (LPVOID) m_bNeedTwoBalancedTrumpHands;
case tnumAcesForSlam:
return (LPVOID) m_numAcesForSlam[nIndex1];
case tnumKingsForSlam:
return (LPVOID) m_numKingsForSlam[nIndex1];
case tbEnableDealNumbering:
return (LPVOID) m_bEnableDealNumbering;
/*
case tnBiddingEngine:
return (LPVOID) m_nBiddingEngine;
case tbNNetTrainingMode:
return (LPVOID) m_bNNetTrainingMode;
case tszNeuralNetFile:
return (LPVOID) (LPCTSTR) m_strNeuralNetFile;
case tnumNeuralNetInputs:
return (LPVOID) tnumNNetInputs;
case tnumNeuralNetOutputs:
return (LPVOID) tnumNNetOutputs;
case tnumNeuralNetHiddenLayers:
return (LPVOID) m_numNNetHiddenLayers;
case tnumNeuralNetUnitsPerHiddenLayer:
return (LPVOID) m_numNNetNodesPerHiddenLayer;
*/
// scoring options
case tbScoreHonorsBonuses:
return (LPVOID) m_bScoreHonorsBonuses;
// counting options
case tnHonorsValuationMode:
return (LPVOID) m_nHonorsValuationMode;
case tb4AceBonus:
return (LPVOID) m_b4AceBonus;
case tbAcelessPenalty:
return (LPVOID) m_bAcelessPenalty;
case tbCountShortSuits:
return (LPVOID) m_bCountShortSuits;
case tbPenalizeUGHonors:
return (LPVOID) m_bPenalizeUGHonors;
//
default:
AfxMessageBox("Unhandled Call to CEasyBApp::GetValuePV()");
return (LPVOID) NULL;
}
return NULL;
}
//
double CEasyBApp::GetValueDouble(int nItem, int nIndex1, int nIndex2, int nIndex3)
{
switch(nItem)
{
case tfAceValue:
return m_fAceValue;
case tfKingValue:
return m_fKingValue;
case tfQueenValue:
return m_fQueenValue;
case tfJackValue:
return m_fJackValue;
case tfTenValue:
return m_fTenValue;
//
case tfDefaultMajorSuitGamePts:
return m_fDefaultMajorSuitGamePts;
case tfDefaultMinorSuitGamePts:
return m_fDefaultMinorSuitGamePts;
case tfDefaultNTGamePts:
return m_fDefaultNTGamePts;
case tfDefault4LevelPts:
return m_fDefault4LevelPts;
case tfDefault3LevelPts:
return m_fDefault3LevelPts;
case tfDefault2LevelPts:
return m_fDefault2LevelPts;
case tfDefaultSlamPts:
return m_fDefaultSlamPts;
case tfDefaultGrandSlamPts:
return m_fDefaultGrandSlamPts;
//
case tfMajorSuitGamePts:
return m_fMajorSuitGamePts;
case tfMinorSuitGamePts:
return m_fMinorSuitGamePts;
case tfNTGamePts:
return m_fNTGamePts;
case tf4LevelPts:
return m_f4LevelPts;
case tf3LevelPts:
return m_f3LevelPts;
case tf2LevelPts:
return m_f2LevelPts;
case tfSlamPts:
return m_fSlamPts;
case tfGrandSlamPts:
return m_fGrandSlamPts;
//
case tfBiddingAggressiveness:
return m_fBiddingAggressiveness;
//
case tfCustomAceValue:
return m_fCustomAceValue;
case tfCustomKingValue:
return m_fCustomKingValue;
case tfCustomQueenValue:
return m_fCustomQueenValue;
case tfCustomJackValue:
return m_fCustomJackValue;
case tfCustomTenValue:
return m_fCustomTenValue;
default:
AfxMessageBox("Unhandled Call to CEasyBApp::GetValueDouble()");
return 0;
}
return 0;
}
//
int CEasyBApp::SetValuePV(int nItem, LPVOID value, int nIndex1, int nIndex2, int nIndex3)
{
int nVal = (int) value;
BOOL bVal = (BOOL) value;
LPCTSTR sVal = (LPCTSTR) value;
//
//
switch(nItem)
{
case tbAutoBidStart:
m_bAutoBidStart = bVal;
break;
case tbAutoJumpCursor:
m_bAutoJumpCursor = bVal;
break;
case tbAutoPlayLastCard:
m_bAutoPlayLastCard = bVal;
break;
case tbAutoShowBidHistory:
m_bAutoShowBidHistory = bVal;
break;
case tbAutoShowPlayHistory:
m_bAutoShowPlayHistory = bVal;
break;
case tbAutoHideBidHistory:
m_bAutoHideBidHistory = bVal;
break;
case tbAutoHidePlayHistory:
m_bAutoHidePlayHistory = bVal;
break;
case tbAutoShowNNetOutputWhenTraining:
m_bAutoShowNNetOutputWhenTraining = bVal;
break;
case tbCollapseGameReviewDialog:
m_bCollapseGameReviewDialog = bVal;
break;
case tbBiddingInProgress:
m_bBiddingInProgress = bVal;
break;
case tbGameInProgress:
m_bGameInProgress = bVal;
break;
case tbRubberInProgress:
m_bRubberInProgress = bVal;
break;
case tbUsingDuplicateScoring:
m_bDuplicateScoring = bVal;
break;
case tbDebugMode:
m_bDebugMode = bVal;
break;
case tbManualBidding:
m_bManualBidding = bVal;
break;
case tbAutoTestMode:
m_bAutoTestMode = bVal;
break;
case tnAutoHintMode:
m_nAutoHintMode = nVal;
break;
case tnAutoHintTraceLevel:
m_nAutoHintTraceLevel = nVal;
break;
case tbEnableAnalysisTracing:
m_bEnableAnalysisTracing = bVal;
break;
case tbEnableAnalysisDuringHints:
m_bEnableAnalysisDuringHints = bVal;
break;
case tnAnalysisTraceLevel:
m_nAnalysisTraceLevel = nVal;
break;
case tbShowCommentIdentifiers:
m_bShowCommentIdentifiers = bVal;
break;
case tbInsertBiddingPause:
m_bInsertBiddingPause = bVal;
break;
case tnBiddingPauseLength:
m_nBiddingPauseLength = nVal;
break;
case tbInsertPlayPause: