本文整理汇总了C++中Preferences函数的典型用法代码示例。如果您正苦于以下问题:C++ Preferences函数的具体用法?C++ Preferences怎么用?C++ Preferences使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Preferences函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write_log
LRESULT COpenHoldemHopperCommunication::OnIsReadyMessage(WPARAM, LPARAM)
{
write_log(Preferences()->debug_hopper_messages(), "[COpenHoldemHopperCommunication] Received 0x8007: OnIsReadyMessage\n");
// 0 = Not ready, because of either
// * no formula
// * no tablemap
if (p_function_collection->FormulaName() == ""
|| p_formula_parser->IsParsing()
|| p_tablemap_loader->NumberOfTableMapsLoaded() < 1)
{
write_log(Preferences()->debug_hopper_messages(),
"[COpenHoldemHopperCommunication] OnIsReadyMessage() not ready\n");
return 0;
}
// Otherwise:
// 1 = ready and not connected
// 2 = ready, but already connected
else if (p_autoconnector->attached_hwnd() == NULL)
{
write_log(Preferences()->debug_hopper_messages(),
"[COpenHoldemHopperCommunication] OnIsReadyMessage() ready\n");
return 1;
}
else
{
write_log(Preferences()->debug_hopper_messages(),
"[COpenHoldemHopperCommunication] OnIsReadyMessage() already connected\n");
return 2;
}
}
示例2: write_log
void CFileSystemMonitor::InitMonitor() {
_scraper_directory_on_a_network_drive = false;
// http://msdn.microsoft.com/de-de/library/windows/desktop/bb773640%28v=vs.85%29.aspx
if (PathIsNetworkPath(absolute_path_to_scraper_directory)) {
// Network mapped drives are unsupported
// and can lead to crashes.
// http://www.maxinmontreal.com/forums/viewtopic.php?f=114&t=17677&p=122925#p122925
write_log(Preferences()->debug_filesystem_monitor(), "[CFileSystemMonitor] Unsupported network mapped drive\n");
_scraper_directory_on_a_network_drive = true;
return;
}
int changes_to_monitor = FILE_NOTIFY_CHANGE_FILE_NAME
| FILE_NOTIFY_CHANGE_SIZE
| FILE_NOTIFY_CHANGE_LAST_WRITE;
// Since OpenHoldem 13.0 we support a nested scraper-directory,
// even with some "official" maps for real-world-casinos.
const bool watch_subtree = TRUE;
dwChangeHandle = FindFirstChangeNotification(
absolute_path_to_scraper_directory,
watch_subtree,
changes_to_monitor);
if ((dwChangeHandle == INVALID_HANDLE_VALUE) || (dwChangeHandle == NULL)) {
write_log(Preferences()->debug_filesystem_monitor(), "[CFileSystemMonitor] InitMonitor() failed.\n");
write_log(Preferences()->debug_filesystem_monitor(), "[CFileSystemMonitor] Going to terminate...\n");
ExitProcess(GetLastError());
}
}
示例3: time
void CSharedMem::RememberTimeOfLastFailedAttemptToConnect() {
ENT;
time(&last_failed_attempt_to_connect);
write_log(Preferences()->debug_autoconnector(), "[CSharedMem] Set last_failed_attempt_to_connect %d\n", last_failed_attempt_to_connect);
session_ID_of_last_instance_that_failed_to_connect = p_sessioncounter->session_id();
write_log(Preferences()->debug_autoconnector(), "[CSharedMem] Instance %d failed to connect\n", session_ID_of_last_instance_that_failed_to_connect);
}
示例4: AdjustedBetsize
double AdjustedBetsize(double amount_to_raise_to) {
double original_amount_to_raise_to = amount_to_raise_to;
write_log(Preferences()->debug_betsize_adjustment(),
"[BetsizeAdjustment] Rounding to beautiful numbers\n");
// Rounding to beautiful numbers but only if enabled
amount_to_raise_to = RoundToBeautifulBetsize(amount_to_raise_to);
double minimum;
if (p_engine_container->symbol_engine_casino()->ConnectedToDDPoker()) {
write_log(Preferences()->debug_betsize_adjustment(),
"[BetsizeAdjustment] Special adjustment for DDPoker needed.\n");
minimum = min(MinimumBetsizeDueToPreviousRaise(), MaximumBetsizeDueToMaxOppStack() );
} else {
minimum = MinimumBetsizeDueToPreviousRaise();
}
AdaptValueToMinMaxRange(&amount_to_raise_to, minimum, amount_to_raise_to);
AdaptValueToMinMaxRange(&amount_to_raise_to, amount_to_raise_to, MaximumBetsizeForGameType());
AdaptValueToMinMaxRange(&amount_to_raise_to, amount_to_raise_to, MaximumPossibleBetsizeBecauseOfBalance());
// Rounding to beautiful numbers (here full dollars)
AdaptValueToMinMaxRange(&amount_to_raise_to, amount_to_raise_to, RoundedBetsizeForTournaments(amount_to_raise_to));
// Special handling for DDPoker
// http://www.maxinmontreal.com/forums/viewtopic.php?f=120&t=19185&hilit=ddpoker
if(p_engine_container->symbol_engine_casino()->ConnectedToDDPoker()){
//!!?? Duplicate to ZeeZooLaas code above?
AdaptValueToMinMaxRange(&amount_to_raise_to, amount_to_raise_to, MaximumBetsizeDueToMaxOppStack());
}
AdaptValueToMinMaxRange(&amount_to_raise_to, 0, SwagAmountAjustedToCasino(amount_to_raise_to));
return amount_to_raise_to;
}
示例5: write_log
bool CScraper::ProcessRegion(RMapCI r_iter) {
write_log(Preferences()->debug_scraper(),
"[CScraper] ProcessRegion %s (%i, %i, %i, %i)\n",
r_iter->first, r_iter->second.left, r_iter->second.top,
r_iter->second.right, r_iter->second.bottom);
write_log(Preferences()->debug_scraper(),
"[CScraper] ProcessRegion color %i radius %i transform %s\n",
r_iter->second.color, r_iter->second.radius, r_iter->second.transform);
__HDC_HEADER
// Get "current" bitmap
old_bitmap = (HBITMAP) SelectObject(hdcCompatible, r_iter->second.cur_bmp);
BitBlt(hdcCompatible, 0, 0, r_iter->second.right - r_iter->second.left + 1,
r_iter->second.bottom - r_iter->second.top + 1,
hdc, r_iter->second.left, r_iter->second.top, SRCCOPY);
SelectObject(hdcCompatible, old_bitmap);
// If the bitmaps are different, then continue on
if (!BitmapsAreEqual(r_iter->second.last_bmp, r_iter->second.cur_bmp)) {
// Copy into "last" bitmap
old_bitmap = (HBITMAP) SelectObject(hdcCompatible, r_iter->second.last_bmp);
BitBlt(hdcCompatible, 0, 0, r_iter->second.right - r_iter->second.left + 1,
r_iter->second.bottom - r_iter->second.top + 1,
hdc, r_iter->second.left, r_iter->second.top, SRCCOPY);
SelectObject(hdcCompatible, old_bitmap);
__HDC_FOOTER_ATTENTION_HAS_TO_BE_CALLED_ON_EVERY_FUNCTION_EXIT_OTHERWISE_MEMORY_LEAK
return true;
}
示例6: BetSizeIsAllin
bool BetSizeIsAllin(double amount_to_raise_to_in_dollars_and_cents) {
double maximum_betsize = MaximumPossibleBetsizeBecauseOfBalance();
write_log(Preferences()->debug_betsize_adjustment(), "[BetsizeAdjustment] BetSizeIsAllin() desired betsize: %.2f\n",
amount_to_raise_to_in_dollars_and_cents);
write_log(Preferences()->debug_betsize_adjustment(), "[BetsizeAdjustment] BetSizeIsAllin() maximum betsize: %.2f\n",
maximum_betsize);
return (amount_to_raise_to_in_dollars_and_cents >= maximum_betsize);
}
示例7:
BOOL CDlgSAPrefs9::OnInitDialog()
{
CSAPrefsSubDlg::OnInitDialog();
m_use_auto_starter.SetCheck(Preferences()->use_auto_starter() ? BST_CHECKED : BST_UNCHECKED);
m_use_auto_shutdown.SetCheck(Preferences()->use_auto_shutdown() ? BST_CHECKED : BST_UNCHECKED);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例8: write_log
void CSymbolEngineReplayFrameController::UpdateAfterAutoplayerAction(int autoplayer_action_code) {
if (Preferences()->replay_record() == kShootReplyFramesOnMyTurn) {
// Replay-frame already in scraper memory, it only needs to be stored.
// Therefore it does not matter if we shoot "after" action.
write_log(Preferences()->debug_replayframes(), "[CSymbolEngineReplayFrameController] Replay required (on my turn and time to act)\n");
ShootReplayFrameIfNotYetDone();
}
}
示例9: if
bool CRebuyManagement::OcclusionCheck() {
if (!Preferences()->rebuy_condition_heuristic_check_for_occlusion()) {
return true;
} else if (p_occlusioncheck->UserBalanceOccluded()) {
write_log(Preferences()->debug_rebuy(), "[CRebuyManagement] OcclusionCheck: false (occluded)\n");
return false;
}
write_log(Preferences()->debug_rebuy(), "[CRebuyManagement] OcclusionCheck: true (not occluded)\n");
return true;
}
示例10: write_log
bool CAllinSlider::SlideAllin() {
if (!SlideAllinPossible()) {
write_log(Preferences()->debug_autoplayer(), "[AllinSlider] ...ending DoSlider early (i3handle or i3slider are not defined in the tablemap)\n");
return false;
}
write_log(Preferences()->debug_autoplayer(), "[AllinSlider] Starting DoSlider...\n");
if ((_position.x == kUndefined) || (_position.y == kUndefined)) {
write_log(Preferences()->debug_autoplayer(), "[AllinSlider] ...ending DoSlider early (handle not found - i3handle must use a transform that resolves to either 'handle' or 'true')\n");
return false;
}
// Click and drag handle
RECT drag_region;
GetSliderRegions();
drag_region.left = _position.x + ((_i3_handle.right - _i3_handle.left) / 2);
drag_region.top = _position.y + ((_i3_handle.bottom - _i3_handle.top) / 2);
drag_region.right = _position.x + (_i3_slider.right - _i3_slider.left);
drag_region.bottom = drag_region.top;
write_log(Preferences()->debug_autoplayer(), "[AllinSlider] Slider : Calling mouse.dll to jam from %d,%d to %d,%d\n", drag_region.left, drag_region.top, drag_region.right, drag_region.bottom);
// Not really (0, 0), but (-1, -1), out of the screen
POINT point_null = { kUndefined, kUndefined };
(theApp._dll_mouse_click_drag) (p_autoconnector->attached_hwnd(), drag_region);
write_log(Preferences()->debug_autoplayer(), "[AllinSlider] Sleeping %d ms\n.", Preferences()->swag_delay_3());
Sleep(Preferences()->swag_delay_3());
// Click confirmation button
p_casino_interface->_betsize_input_box.Confirm();
write_log(Preferences()->debug_autoplayer(), "[AllinSlider] Jam complete: %d,%d,%d,%d\n", drag_region.left, drag_region.top, drag_region.right, drag_region.bottom);
write_log(Preferences()->debug_autoplayer(), "[AllinSlider] ...ending DoSlider.\n");
return true;
}
示例11: ChangeInHandNumber
bool CRebuyManagement::RebuyPossible() {
if (MinimumDelayElapsed()
&& ChangeInHandNumber()
&& NoCards()
&& OcclusionCheck()) {
write_log(Preferences()->debug_rebuy(), "[CRebuyManagement] RebuyPossible: true\n");
return true;
} else {
write_log(Preferences()->debug_rebuy(), "[CRebuyManagement] RebuyPossible: false\n");
return false;
}
}
示例12: Preferences
bool CRebuyManagement::MinimumDelayElapsed() {
unsigned int MinimumTimeDifference = Preferences()->rebuy_minimum_time_to_next_try();
// Make sure, we don't try to rebuy too often in a short time
time(&CurrentTime);
double RebuyTimeDifference = difftime(CurrentTime, RebuyLastTime);
write_log(Preferences()->debug_rebuy(), "[CRebuyManagement] Time since last rebuy %.2f\n", RebuyTimeDifference);
if (RebuyTimeDifference < MinimumTimeDifference) {
write_log(Preferences()->debug_rebuy(), "[CRebuyManagement] MinimumDelayElapsed(): false\n");
return false;
}
return true;
}
示例13: write_log
void CIteratorThread::RestartPrWinComputations() {
if (p_engine_container->symbol_engine_isomaha()->isomaha()) {
write_log(Preferences()->debug_prwin(), "[PrWinThread] Not restarting prwin computations, PrWin is Hold'em only\n");
return;
}
write_log(Preferences()->debug_prwin(), "[PrWinThread] Restarting prwin computations.\n");
assert(p_iterator_thread != NULL);
assert(IteratorThreadWorking() == false);
InitIteratorLoop();
ResetIteratorVars();
ResetGlobalVariables();
}
示例14: write_log
void CHeartbeatThread::AutoConnect() {
write_log(Preferences()->debug_alltherest(), "[CHeartbeatThread] location Johnny_D\n");
assert(!p_autoconnector->IsConnectedToAnything());
if (Preferences()->autoconnector_when_to_connect() == k_AutoConnector_Connect_Permanent) {
if (p_autoconnector->SecondsSinceLastFailedAttemptToConnect() > 1 /* seconds */) {
write_log(Preferences()->debug_autoconnector(), "[CHeartbeatThread] going to call Connect()\n");
p_autoconnector->Connect(NULL);
} else {
write_log(Preferences()->debug_autoconnector(), "[CHeartbeatThread] Reconnection blocked. Other instance failed previously.\n");
}
}
}
示例15: AfxGetInstanceHandle
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) {
if ( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
int max_x = 0, max_y = 0;
WNDCLASS wnd;
HINSTANCE hInst = AfxGetInstanceHandle();
// Set class name
if (!(::GetClassInfo(hInst, Preferences()->window_class_name(), &wnd))) {
wnd.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
wnd.lpfnWndProc = ::DefWindowProc;
wnd.cbClsExtra = wnd.cbWndExtra = 0;
wnd.hInstance = hInst;
wnd.hIcon = AfxGetApp()->LoadIcon(IDI_ICON1);
wnd.hCursor = AfxGetApp()->LoadStandardCursor(IDC_ARROW);
wnd.hbrBackground = (HBRUSH) (COLOR_3DFACE + 1);
wnd.lpszMenuName = NULL;
wnd.lpszClassName = Preferences()->window_class_name();
// Fixed size window, not resizable
// Because bad-sized windows are annoying
// and because of potential support for a 4th user-card ;-)
// http://arstechnica.com/civis/viewtopic.php?f=20&t=848676
// http://msdn.microsoft.com/en-us/library/aa925944.aspx
cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
cs.style &= (0xFFFFFFFF ^ WS_SIZEBOX);
cs.style |= WS_BORDER;
cs.style &= (0xFFFFFFFF ^ WS_MAXIMIZEBOX);
AfxRegisterClass( &wnd );
}
cs.lpszClass = Preferences()->window_class_name();
// Restore window location and size
// -32 to avoid placement directly under the taskbar,
// so that at least a little bit is visible
// if the values in the ini-file are out of range.
max_x = GetSystemMetrics(SM_CXSCREEN) - GetSystemMetrics(SM_CXICON - 32);
max_y = GetSystemMetrics(SM_CYSCREEN) - GetSystemMetrics(SM_CYICON - 32);
// Make sure that our coordinates are not out of screen
// (too large or even negative)
cs.x = min(Preferences()->main_x(), max_x);
cs.y = min(Preferences()->main_y(), max_y);
cs.x = max(cs.x, 0);
cs.y = max(cs.y, 0);
// GUI size
cs.cx = kMainSizeX;
cs.cy = kMainSizeY;
return true;
}