//------------------------------------------------------------------------------ // shutdownNotification() -- Shutdown the simulation //------------------------------------------------------------------------------ bool Antenna::shutdownNotification() { setSystem(0); clearQueues(); return BaseClass::shutdownNotification(); }
void Antenna::deleteData() { setSystem(0); setSlotGainPattern(0); clearQueues(); }
void QSGParticlePainter::componentComplete() { if (!m_system && qobject_cast<QSGParticleSystem*>(parentItem())) setSystem(qobject_cast<QSGParticleSystem*>(parentItem())); if (!m_system) qWarning() << "ParticlePainter created without a particle system specified";//TODO: useful QML warnings, like line number? QSGItem::componentComplete(); }
// The setup method does the actual preparations bool SnapShotManager::setup(System* my_system, const ForceField* my_forcefield, TrajectoryFile* my_snapshot_file) throw() { setSystem(my_system); setForceField(my_forcefield); setTrajectoryFile(my_snapshot_file); return setup(); }
void RobotWidget::setRobot(RobotConfig *rbt) { setConfigPath(rbt->configFilePath.toStdString()); setRobotName(rbt->robotName.toStdString()); setSystem(rbt->system.toStdString()); setDriveSystem(rbt->driveSystem.toStdString()); setRobotPicture(rbt->image); setRobotNamespace(rbt->nameSpace.toStdString()); }
void Blink1Pattern::fromJson( QJsonObject obj) { setName( obj.value("name").toString() ); setRepeats(obj.value("repeats").toInt()); QString tmp=obj.value("pattern").toString(); fromPatternStr(tmp); setDate(obj.value("date").toDouble()); setReadOnly(obj.value("readonly").toBool()); setSystem(obj.value("system").toBool()); }
Ultrasonic::Ultrasonic(int trigger_pin, int echo_pin) { this->trigger_pin = trigger_pin; this->echo_pin = echo_pin; pinMode(trigger_pin, OUTPUT); pinMode(echo_pin, INPUT); setRange(0,100); setSystem(CM); setTimeout(DEFAULT_TIMEOUT); }
void ECSWorld::createWorld(R::Match_Type matchType){ ignoreWorld(false); this->matchType = matchType; AdsManager::showAds(true); if (R::Constants::musicEnable) { srand(time(NULL)); int rad = rand() / 6 + 1; CocosDenshion::SimpleAudioEngine::getInstance()->setBackgroundMusicVolume(R::Constants::musicVolumn); if (rad <= 2) CocosDenshion::SimpleAudioEngine::getInstance()->playBackgroundMusic(R::Constants::THEME_2, true); else if (rad <= 4) CocosDenshion::SimpleAudioEngine::getInstance()->playBackgroundMusic(R::Constants::THEME_1, true); else CocosDenshion::SimpleAudioEngine::getInstance()->playBackgroundMusic(R::Constants::THEME_3, true); } std::string str = "backgrounds/bg6.png"; switch (matchType){ case R::Match_Type::GOKU_BEAR: R::Constants::lastPlay = 0; str = "backgrounds/bg6.png"; break; case R::Match_Type::GOKU_TEGIAC: str = "backgrounds/bg7.png"; R::Constants::lastPlay = 1; break; case R::Match_Type::GOKU_KARILLIN: str = "backgrounds/bg4.png"; R::Constants::lastPlay = 2; break; case R::Match_Type::GOKU_GIRAN: str = "backgrounds/bg5.png"; R::Constants::lastPlay = 3; break; case R::Match_Type::GOKU_RUA: str = "backgrounds/bg1.png"; R::Constants::lastPlay = 4; break; case R::Match_Type::GOKU_CAMAP: str = "backgrounds/bg3.png"; R::Constants::lastPlay = 5; break; case R::Match_Type::GOKU_JACKIECHUN: str = "backgrounds/bg2.png"; R::Constants::lastPlay = 6; break; case R::Match_Type::GOKU_PICOLO: str = "backgrounds/bg8.png"; R::Constants::lastPlay = 7; break; default: break; } Sprite* bg = Sprite::create(str); bg->setAnchorPoint(Vec2(0, 0)); bg->setPosition(Vec2(0, 0)); RenderLayer::getInstance()->getBackgroundLayer()->addChild(bg); world = new artemis::World(); EntityUtils::getInstance()->setWorld(world); createEnemyCharacter(); createMainCharacter(); createCameraFollowEntity(); GameStateComponent* gameStateComponent = new GameStateComponent(); //create GameState system manager artemis::Entity &e = world->createEntity(); e.addComponent(gameStateComponent); e.setTag("gameState"); e.refresh(); //create CharacterUI system manager artemis::Entity &ui = world->createEntity(); ui.addComponent(new CharacterUIComponent()); ui.setTag("characterrender"); ui.refresh(); inputSystem = new InputSystem(); setSystem(inputSystem); setSystem(new SpecialSkillSystem()); setSystem(new PhysicSystem()); setSystem(new GravitySystem()); setSystem(new MapCollisionSystem()); setSystem(new WallSensorSystem()); setSystem(new AttackSystem()); setSystem(new MotionSystem()); setSystem(new SkeletonSystem()); // setSystem(new UICharacterSystem()); setSystem(new RenderSystem()); setSystem(new CatFollowGokuSystem()); setSystem(new BombSystem()); setSystem(new SkillSystem()); //setSystem(new DebugSystem()); setSystem(new DecisionSystem()); setSystem(new GameStateSystem()); setSystem(new CharacterStateSystem()); setSystem(new RemoveEntitySystem()); setSystem(new CameraFollowSystem()); if (matchType == R::Match_Type::GOKU_BEAR_INTRODUCE){ //createIntroduceEntity introduceSystem = new IntroduceSystem(); artemis::Entity &introduceEntity = world->createEntity(); introduceEntity.addComponent(new IntroduceComponent()); introduceEntity.setTag("introduceEntity"); introduceEntity.refresh(); setSystem(introduceSystem); } else{ setSystem(new CharacterRenderSystem()); } world->getSystemManager()->initializeAll(); gameHud = new GameHud(Director::getInstance()->getOpenGLView()->getFrameSize()); gameHud->setAnchorPoint(Vec2(.5, .5)); gameHud->buildComponent(); gameHud->setCallBack([=](Touch* touch, GameHud::EventType event, GameHud::TouchType type) { ECSWorld::getInstance()->notifyInput(touch, event, type); }); RenderLayer::getInstance()->getHudLayer()->addChild(gameHud); RenderLayer::getInstance()->getHudLayer()->setCameraMask((unsigned short)CameraFlag::USER1); if (isReplayGame){ gameStateComponent->setGameState(R::GameState::PREPARE); isReplayGame = false; } else{ ui::Text* text = ui::Text::create("TOUCH TO BEGIN", "fonts/courbd.ttf", 30); text->setColor(Color3B::WHITE); text->enableOutline(Color4B::BLACK, 2); Node* node = RenderLayer::getInstance()->createHudNode(); node->setContentSize(Size(R::Constants::WIDTH_SCREEN, R::Constants::HEIGHT_SCREEN)); text->setAnchorPoint(Vec2(.5, .5)); text->setPosition(Size(node->getContentSize().width / 2, node->getContentSize().height / 3)); auto fadeIn = FadeIn::create(.5); auto fadeOut = FadeOut::create(.5); text->runAction(RepeatForever::create(Sequence::create(fadeIn, fadeOut, nullptr))); node->addChild(text); node->setTag(200); node->setCameraMask((unsigned short)CameraFlag::USER1); } R::Constants::updateVariable(); }
void QQuickParticleEmitter::componentComplete() { if (!m_system && qobject_cast<QQuickParticleSystem*>(parentItem())) setSystem(qobject_cast<QQuickParticleSystem*>(parentItem())); QQuickItem::componentComplete(); }
void RomInfo::fillData() { if (m_gamename == "") { return; } MSqlQuery query(MSqlQuery::InitCon()); QString systemtype; if (m_system != "") { systemtype += " AND system = :SYSTEM "; } QString thequery = "SELECT system,gamename,genre,year,romname,favorite," "rompath,country,crc_value,diskcount,gametype,plot,publisher," "version,screenshot,fanart,boxart,inetref,intid FROM gamemetadata " "WHERE gamename = :GAMENAME " + systemtype + " ORDER BY diskcount DESC"; query.prepare(thequery); query.bindValue(":SYSTEM", m_system); query.bindValue(":GAMENAME", m_gamename); if (query.exec() && query.next()) { setSystem(query.value(0).toString()); setGamename(query.value(1).toString()); setGenre(query.value(2).toString()); setYear(query.value(3).toString()); setRomname(query.value(4).toString()); setField("favorite",query.value(5).toString()); setRompath(query.value(6).toString()); setCountry(query.value(7).toString()); setCRC_VALUE(query.value(8).toString()); setDiskCount(query.value(9).toInt()); setGameType(query.value(10).toString()); setPlot(query.value(11).toString()); setPublisher(query.value(12).toString()); setVersion(query.value(13).toString()); setScreenshot(query.value(14).toString()); setFanart(query.value(15).toString()); setBoxart(query.value(16).toString()); setInetref(query.value(17).toString()); setId(query.value(18).toInt()); } setRomCount(romInDB(m_romname,m_gametype)); // If we have more than one instance of this rom in the DB fill in all // systems available to play it. if (RomCount() > 1) { query.prepare("SELECT DISTINCT system FROM gamemetadata " "WHERE romname = :ROMNAME"); query.bindValue(":ROMNAME", Romname()); if (!query.exec()) MythDB::DBError("RomInfo::fillData - selecting systems", query); while (query.next()) { if (m_allsystems.isEmpty()) m_allsystems = query.value(0).toString(); else m_allsystems += "," + query.value(0).toString(); } } else { m_allsystems = m_system; } }
EntitySystem* EntityWorld::setSystem( SystemType p_type, EntitySystem* p_system, bool p_enabled ) { return setSystem( (SystemType::SystemTypeIdx)p_type.getIndex(), p_system, p_enabled ); }
EntitySystem* EntityWorld::setSystem( EntitySystem* p_system, bool p_enabled ) { return setSystem( p_system->getSystemType(), p_system, p_enabled ); }
void QQuickParticleGroup::componentComplete(){ if (!m_system && qobject_cast<QQuickParticleSystem*>(parent())) setSystem(qobject_cast<QQuickParticleSystem*>(parent())); }
void Rating::setAttribute( QDomAttr &attr) { if(attr.localName().compare("System", Qt::CaseInsensitive)==0) { setSystem(attr.value()); return; } }