zDHPart::zDHPart(PubKeySupported::Enum packet) { DBGLOGLINE("Creating DHpart packet without data"); _Initialize(); SetPubKeyType(packet); }
Image::Image(const Size &Size, const Type &Type, const float &v) : mSize(Hydrax::Size(Size.Width+1,Size.Height+1)) , mChannels(static_cast<int>(Type)) , mData(0) { _Initialize(v); }
Image::Image(const Size &Size) : mSize(Hydrax::Size(Size.Width+1,Size.Height+1)) , mChannels(static_cast<int>(TYPE_RGBA)) , mData(0) { _Initialize(0); }
GrammarInfo::GrammarInfo(VXIrecGrammar * g, const vxistring & id, const VXMLElement & elem) : element(elem), recgrammar(g), scope(GRS_NONE), docID(id), enabled(false) { // (1) Determine the grammar scope. // (1.1) Obtain default from position in the tree. VXMLElement par = elem; while (par != 0) { VXMLElementType name = par.GetName(); if (name == NODE_INITIAL || name == NODE_FIELD || name == NODE_RECORD || name == NODE_TRANSFER) { scope = GRS_FIELD; break; } else if (name == NODE_FORM || name == NODE_MENU) { scope = GRS_DIALOG; break; } else if (name == NODE_VXML) { scope = GRS_DOC; break; } par = par.GetParent(); } // (1.2) if scope explicitly specified in grammar or parent, override! vxistring str; elem.GetAttribute(ATTRIBUTE_SCOPE, str); if (str.empty() && par != 0) { par.GetAttribute(ATTRIBUTE_SCOPE, str); } if (!str.empty()) { if (str == L"dialog") scope = GRS_DIALOG; else if (str == L"document") scope = GRS_DOC; } // (2) Do remaining initialization. _Initialize(elem); }
BNetworkCookieJar::UrlIterator& BNetworkCookieJar::UrlIterator::operator=( const BNetworkCookieJar::UrlIterator& other) { if (this == &other) return *this; // Teardown if (fList) fList->Unlock(); delete fIterator; // Init fCookieJar = other.fCookieJar; fIterator = NULL; fList = NULL; fLastList = NULL; fElement = NULL; fLastElement = NULL; fIndex = 0; fLastIndex = 0; fUrl = other.fUrl; _Initialize(); return *this; }
void Matrix3D::_SetIdentityMatrix() { double m[16] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 }; _Initialize(m); }
int CMainFrame::OnCreate( LPCREATESTRUCT lpCreateStruct ) { if ( -1 == CFrameWnd::OnCreate( lpCreateStruct ) ) { return -1; } _Initialize( ); return 0; }
MkSystemEnvironment::MkSystemEnvironment() : MkSingletonPattern<MkSystemEnvironment>() { wchar_t fullPath[MAX_PATH]; GetModuleFileName(NULL, fullPath, MAX_PATH); m_ApplicationVersion.SetUp(fullPath); m_MiniKeyVersion.SetUp(MKDEF_CORE_MAJOR_VERSION, MKDEF_CORE_MINOR_VERSION, MKDEF_CORE_BUILD_VERSION, MKDEF_CORE_REVISION_VERSION); _Initialize(); }
LocaleRosterData::LocaleRosterData(const BLanguage& language, const BFormattingConventions& conventions) : fLock("LocaleRosterData"), fDefaultLocale(&language, &conventions), fIsFilesystemTranslationPreferred(false), fAreResourcesLoaded(false) { fInitStatus = _Initialize(); }
//=============================================================================================== // PROCEDURE: CloseFile // PURPOSE: Closes the file if it was opened previously. // void CSynch::CloseFile() { MEMBERASSERT(); if (m_hfSynchFile != INVALID_HANDLE_VALUE) { CloseHandle(m_hfSynchFile); m_hfSynchFile = INVALID_HANDLE_VALUE; } _Initialize(); }
D3D11ShaderReflectionVariable::D3D11ShaderReflectionVariable( ID3D11ShaderReflectionVariable* pIVariable, D3D11ShaderReflectionConstantBuffer* pParent) { auto pType = pIVariable->GetType(); pIVariable->GetDesc(&m_Desc); //m_Size = m_Desc.Size; _Initialize(pType); }
void Initialize(Player &u) { if (m_displayId) { if (!m_previewDisplayId) m_previewDisplayId = u.GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID); u.Mount(m_displayId); } u.getHostileRefManager().setOnlineOfflineState(false); u.addUnitState(UNIT_STAT_TAXI_FLIGHT); u.SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT); _Initialize(u); };
//=============================================================================================== // PROCEDURE: CreateFile // PURPOSE: Gets a unique filename and opens it as a temporary file. // BOOL CSynch::OpenFile() { MEMBERASSERT(); _Initialize(); // Get a unique temporary file name. AXU_GetTempFileName("synch", 0, m_szFileName); // Create the temporary file. m_hfSynchFile = CreateFile(m_szFileName, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, NULL); ASSERT(m_hfSynchFile != INVALID_HANDLE_VALUE); return (m_hfSynchFile != INVALID_HANDLE_VALUE); }
void GrammarInfo::_Initialize(const VXMLElement & elem) { if (elem == 0) return; VXMLElementType name = elem.GetName(); if (name == NODE_FIELD || name == NODE_INITIAL || name == NODE_TRANSFER) elem.GetAttribute(ATTRIBUTE__ITEMNAME, field); else if (name == NODE_FORM || name == NODE_MENU) { elem.GetAttribute(ATTRIBUTE__ITEMNAME, dialog); return; } _Initialize(elem.GetParent()); }
BNetworkCookieJar::UrlIterator::UrlIterator(const UrlIterator& other) : fCookieJar(other.fCookieJar), fIterator(NULL), fList(NULL), fLastList(NULL), fElement(NULL), fLastElement(NULL), fIndex(0), fLastIndex(0), fUrl(other.fUrl) { _Initialize(); }
BNetworkCookieJar::UrlIterator::UrlIterator(const BNetworkCookieJar* cookieJar, const BUrl& url) : fCookieJar(const_cast<BNetworkCookieJar*>(cookieJar)), fIterator(NULL), fList(NULL), fLastList(NULL), fElement(NULL), fLastElement(NULL), fIndex(0), fLastIndex(0), fUrl(url) { _Initialize(); }
BTranslatorRoster::BTranslatorRoster(BMessage* model) { _Initialize(); if (model) { const char* path; for (int32 i = 0; model->FindString("be:translator_path", i, &path) == B_OK; i++) { BEntry entry(path); entry_ref ref; if (entry.GetRef(&ref) == B_OK) { int32 count = 0; fPrivate->CreateTranslators(ref, count); } } } }
LRESULT WeaselIME::OnIMESelect(BOOL fSelect) { EZDBGONLYLOGGERPRINT("On IME select: %d, HIMC = 0x%x", fSelect, m_hIMC); if (fSelect) { // initialize weasel client m_client.Connect(launch_server); m_client.StartSession(); return _Initialize(); } else { m_client.EndSession(); return _Finalize(); } }
/** * The run method is used internally to actually run the commands. * @return whether or not the command should stay within the {@link Scheduler}. */ bool Command::Run() { if (!m_runWhenDisabled && m_parent == NULL && DriverStation::GetInstance()->IsDisabled()) Cancel(); if (IsCanceled()) return false; if (!m_initialized) { m_initialized = true; StartTiming(); _Initialize(); Initialize(); } _Execute(); Execute(); return !IsFinished(); }
GlobalEnemy::GlobalEnemy(uint32_t id) : GlobalActor(), _experience_points(0), _sprite_width(0), _sprite_height(0), _drunes_dropped(0) { _id = id; if(_id == 0) { PRINT_ERROR << "invalid id for loading enemy data: " << _id << std::endl; return; } // Open the script file and table that store the enemy data ReadScriptDescriptor& enemy_data = GlobalManager->GetEnemiesScript(); if (!enemy_data.OpenTable(_id)) { PRINT_ERROR << "Failed to open the enemies[" << _id << "] table in: " << enemy_data.GetFilename() << std::endl; return; } // Load the enemy's name and sprite data _name = MakeUnicodeString(enemy_data.ReadString("name")); // Attempt to load the animations for each harm levels _battle_animations.assign(GLOBAL_ENEMY_HURT_TOTAL, AnimatedImage()); if (enemy_data.OpenTable("battle_animations" )) { std::vector<uint32_t> animations_id; enemy_data.ReadTableKeys(animations_id); for (uint32_t i = 0; i < animations_id.size(); ++i) { uint32_t anim_id = animations_id[i]; if (anim_id >= GLOBAL_ENEMY_HURT_TOTAL) { PRINT_WARNING << "Invalid table id in 'battle_animations' table for enemy: " << _id << std::endl; continue; } _battle_animations[anim_id].LoadFromAnimationScript(enemy_data.ReadString(anim_id)); // Updates the sprite dimensions if (_battle_animations[anim_id].GetWidth() > _sprite_width) _sprite_width =_battle_animations[anim_id].GetWidth(); if (_battle_animations[anim_id].GetHeight() > _sprite_height) _sprite_height =_battle_animations[anim_id].GetHeight(); } enemy_data.CloseTable(); // battle_animations } else { PRINT_WARNING << "No 'battle_animations' table for enemy: " << _id << std::endl; } std::string stamina_icon_filename = enemy_data.ReadString("stamina_icon"); if(!stamina_icon_filename.empty()) { if(!_stamina_icon.Load(stamina_icon_filename)) { PRINT_WARNING << "Invalid stamina icon image: " << stamina_icon_filename << " for enemy: " << MakeStandardString(_name) << ". Loading default one." << std::endl; _stamina_icon.Load("data/battles/stamina_icons/default_stamina_icon.png"); } } else { _stamina_icon.Load("data/battles/stamina_icons/default_stamina_icon.png"); } // Loads enemy battle animation scripts if (enemy_data.OpenTable("scripts")) { _death_script_filename = enemy_data.ReadString("death"); _ai_script_filename = enemy_data.ReadString("battle_ai"); enemy_data.CloseTable(); } if (enemy_data.OpenTable("base_stats")) { _max_hit_points = enemy_data.ReadUInt("hit_points"); _hit_points = _max_hit_points; _max_skill_points = enemy_data.ReadUInt("skill_points"); _skill_points = _max_skill_points; _experience_points = enemy_data.ReadUInt("experience_points"); _char_phys_atk.SetBase(enemy_data.ReadUInt("phys_atk")); _char_mag_atk.SetBase(enemy_data.ReadUInt("mag_atk")); _char_phys_def.SetBase(enemy_data.ReadUInt("phys_def")); _char_mag_def.SetBase(enemy_data.ReadUInt("mag_def")); _stamina.SetBase(enemy_data.ReadUInt("stamina")); _evade.SetBase(enemy_data.ReadFloat("evade")); _drunes_dropped = enemy_data.ReadUInt("drunes"); enemy_data.CloseTable(); } // Create the attack points for the enemy if (enemy_data.OpenTable("attack_points")) { uint32_t ap_size = enemy_data.GetTableSize(); for(uint32_t i = 1; i <= ap_size; ++i) { _attack_points.push_back(new GlobalAttackPoint(this)); if (enemy_data.OpenTable(i)) { if(_attack_points.back()->LoadData(enemy_data) == false) { IF_PRINT_WARNING(GLOBAL_DEBUG) << "Failed to load data for an attack point: " << i << std::endl; } enemy_data.CloseTable(); } } enemy_data.CloseTable(); } // Add the set of skills for the enemy if (enemy_data.OpenTable("skills")) { for(uint32_t i = 1; i <= enemy_data.GetTableSize(); ++i) { _skill_set.push_back(enemy_data.ReadUInt(i)); } enemy_data.CloseTable(); } // Load the possible items that the enemy may drop if (enemy_data.OpenTable("drop_objects")) { for(uint32_t i = 1; i <= enemy_data.GetTableSize(); ++i) { enemy_data.OpenTable(i); _dropped_objects.push_back(enemy_data.ReadUInt(1)); _dropped_chance.push_back(enemy_data.ReadFloat(2)); enemy_data.CloseTable(); } enemy_data.CloseTable(); } enemy_data.CloseTable(); // enemies[_id] if(enemy_data.IsErrorDetected()) { PRINT_WARNING << "One or more errors occurred while reading the enemy data - they are listed below" << std::endl << enemy_data.GetErrorMessages() << std::endl; } // stats and skills. _Initialize(); _CalculateAttackRatings(); _CalculateDefenseRatings(); _CalculateEvadeRatings(); }
zDHPart::zDHPart() { DBGLOGLINE("Creating DHPart packet without data and packet type"); _Initialize(); }
Matrix3D::Matrix3D(double m[16]) { _Initialize(m); }
//=============================================================================================== // PROCEDURE: CSynch // PURPOSE: Constructor. // CSynch::CSynch() { MEMBERASSERT(); _Initialize(); }
void MainWindow::MessageReceived(BMessage* message) { switch (message->what) { case MSG_MOUNT_ALL: _MountAll(); break; case MSG_MOUNT: _Mount(fCurrentDisk, fCurrentPartitionID); break; case MSG_UNMOUNT: _Unmount(fCurrentDisk, fCurrentPartitionID); break; case MSG_FORMAT: printf("MSG_FORMAT\n"); break; case MSG_CREATE: { _Create(fCurrentDisk, fCurrentPartitionID); break; } case MSG_INITIALIZE: { BString diskSystemName; if (message->FindString("disk system", &diskSystemName) != B_OK) break; _Initialize(fCurrentDisk, fCurrentPartitionID, diskSystemName); break; } case MSG_DELETE: _Delete(fCurrentDisk, fCurrentPartitionID); break; case MSG_EJECT: // TODO: completely untested, especially interesting // if partition list behaves when partitions disappear if (fCurrentDisk) { // TODO: only if no partitions are mounted anymore? fCurrentDisk->Eject(true); _ScanDrives(); } break; case MSG_SURFACE_TEST: printf("MSG_SURFACE_TEST\n"); break; // TODO: this could probably be done better! case B_DEVICE_UPDATE: printf("B_DEVICE_UPDATE\n"); case MSG_RESCAN: _ScanDrives(); break; case MSG_PARTITION_ROW_SELECTED: // selection of partitions via list view _AdaptToSelectedPartition(); break; case MSG_SELECTED_PARTITION_ID: { // selection of partitions via disk view partition_id id; if (message->FindInt32("partition_id", &id) == B_OK) { if (BRow* row = fListView->FindRow(id)) { fListView->DeselectAll(); fListView->AddToSelection(row); _AdaptToSelectedPartition(); } } break; } default: BWindow::MessageReceived(message); break; } }
BTranslatorRoster::BTranslatorRoster() { _Initialize(); }
BMessageFormat::BMessageFormat(const BLanguage& language, const BString pattern) : BFormat(language, BFormattingConventions()) { _Initialize(UnicodeString::fromUTF8(pattern.String())); }
BMessageFormat::BMessageFormat(const BString pattern) : BFormat() { _Initialize(UnicodeString::fromUTF8(pattern.String())); }
CustomServerEventListener::CustomServerEventListener() : mDataReceived(0) { _Initialize(); }
CustomClientEventListener::CustomClientEventListener() : mDataReceived(0) { QObject::connect(dt::NetworkManager::Get(), SIGNAL(NewEvent(std::shared_ptr<dt::NetworkEvent>)), this, SLOT(_HandleEvent(std::shared_ptr<dt::NetworkEvent>))); _Initialize(); }
ChatLog::ChatLog() : PlayerScript("LexicsChatLog"), _lexics(NULL), _innormativeLog(NULL) { _Initialize(); }