예제 #1
0
/*!
	\brief
	\param
*/
AsTask::AsTask(AsTaskSystem *pSystem) :
m_Status(0),
m_pChild(NULL),
m_pNext(NULL),
m_pParent(NULL),
m_pTaskSystem(pSystem)
{
	s_TaskNumber++;

	SetTag('TASK');

	if (pSystem == NULL) {
		AsAssert(0);
		return;
	}

	m_ID = ++m_pTaskSystem->m_TaskID;

	if (m_pTaskSystem->m_pRoot == NULL) {
		m_pPrev = NULL;
		m_pTaskSystem->m_pRoot = this;
	} else {
		AsTask	*st;
		for (st = m_pTaskSystem->m_pRoot; st->m_pNext != NULL; st = st->m_pNext);
		st->m_pNext = this;
		m_pPrev = st;
	}
	return;
}
예제 #2
0
CMinotaurSpawn::CMinotaurSpawn(const char* filePath, CObjectManager* objManager, CDayNight* dayNight)
{
	string name = filePath;
	string dir = name.substr(name.size() - 1);
	switch (*dir.c_str())
	{
	case 'N':
		m_eDirection = eNorth;
		break;
	case 'S':
		m_eDirection = eSouth;
		break;
	case 'E':
		m_eDirection = eEast;
		break;
	case 'W':
		m_eDirection = eWest;
		break;
	}
	m_pDayNight = dayNight;
	SetTag("MinotaurSpawn");
	LoadFromXML(filePath, objManager);
	this->CreateRenderMeshes();
	CreateSceneBounds();
	this->AddColliders();
	isDay = true;
	isMoving = false;
	LerpRatio = 0.0f;


}
예제 #3
0
int SignatureT::Train(boca::Event const& event, boca::PreCuts const&, Tag tag)
{
    INFO0;
    auto particles = event.GenParticles();
    auto triplets = top_reader_.Multiplets(event);
    auto tops = CopyIfParticle(particles, Id::top);

    auto final_triplets = triplets;
//     auto final_triplets = BestMatches(triplets, tops, tag);
    DEBUG(triplets.size(), tops.size(), final_triplets.size());

    auto doublets = higgs_reader_.Multiplets(event);
    auto higgses = CopyIfParticles(particles, {Id::higgs, Id::CP_violating_higgs});
    auto final_doublets = doublets;
//     auto final_doublets = BestMatches(doublets, higgses, tag);
    DEBUG(doublets.size(), higgses.size(), final_doublets.size());

    auto octets = Triples(final_triplets, final_doublets, [&](Triplet const & triplet_1, Triplet const & triplet_2, Doublet const & doublet) {
        auto octet = Signature(triplet_1, triplet_2, doublet);
        octet.SetTag(tag);
        return octet;
    });
    DEBUG(octets.size());
    return SaveEntries(octets, 1);
}
예제 #4
0
Critter::Critter(Type type, const RN::Vector3 &position) :
    _isFixedAndCantHaveChildren(false)
{
    SetPosition(position);
    SetRenderGroup(31);
    SetTag(kWHCritterTag);

    SetType(type);

    NavigationAgent *agent = new NavigationAgent();
    AddAttachment(agent);

    agent->Enable();
    agent->Release();

    RN::MessageCenter::GetSharedInstance()->AddObserver(kWHWorldSpawningStoppedMessage, [this](RN::Message *message) {
        RemoveFromWorld();
    }, this);

    RN::MessageCenter::GetSharedInstance()->AddObserver(RNCSTR("fuckoff"), [this](RN::Message *message) {

        RN::Value *value = static_cast<RN::Value *>(message->GetObject());
        SetTarget(value->GetValue<RN::Vector3>());

    }, this);
}
예제 #5
0
/*!
*/
AsTask::AsTask(AsTask *pParent) :
m_Status(0),
m_pChild(NULL),
m_pNext(NULL),
m_pParent(pParent)
{
	s_TaskNumber++;

	SetTag('TASK');

	if (pParent == NULL) {
		AsAssert(0);
		return;
	}

	m_pTaskSystem = pParent->m_pTaskSystem;

	m_ID = ++m_pTaskSystem->m_TaskID;

	if (pParent->m_pChild == NULL) {
		pParent->m_pChild = this;
		m_pPrev = pParent;
	} else {
		AsTask	*st;
		for (st = pParent->m_pChild; st->m_pNext != NULL; st = st->m_pNext)	;
		st->m_pNext = this;
		m_pPrev = st;
	}
}
예제 #6
0
void Tags::LoadDefaults()
{
   wxString path;
   wxString name;
   wxString value;
   long ndx;
   bool cont;

   // Set the parent group
   path = gPrefs->GetPath();
   gPrefs->SetPath(wxT("/Tags"));

   // Process all entries in the group
   cont = gPrefs->GetFirstEntry(name, ndx);
   while (cont) {
      gPrefs->Read(name, &value, wxT(""));

      if (name == wxT("ID3V2")) {
         // LLL:  This is obsolute, but it must be handled and ignored.
      }
      else {
         SetTag(name, value);
      }

      cont = gPrefs->GetNextEntry(name, ndx);
   }

   // Restore original group
   gPrefs->SetPath(path);
}
예제 #7
0
void GameObject::DeSerialize(PersistentData& storageData)
{
	mID = static_cast<GameID>(storageData.GetPropertyU("ID"));
	mOwner = static_cast<GameID>(storageData.GetPropertyU("Owner"));
	std::string s = storageData.GetProperty("Tag");
	SetTag(s);
}
예제 #8
0
파일: bot.cpp 프로젝트: DenMSC/qfusion
Bot::Bot(edict_t *self_, float skillLevel_)
    : Ai(self_, PREFERRED_TRAVEL_FLAGS, ALLOWED_TRAVEL_FLAGS),
      dangersDetector(self_),
      botBrain(self_, skillLevel_),
      skillLevel(skillLevel_),
      nextBlockedEscapeAttemptAt(0),
      blockedEscapeGoalOrigin(INFINITY, INFINITY, INFINITY),
      rocketJumpMovementState(self_),
      combatMovePushTimeout(0),
      vsayTimeout(level.time + 10000),
      isWaitingForItemSpawn(false),
      isInSquad(false),
      defenceSpotId(-1),
      offenseSpotId(-1),
      builtinFireTargetCache(self_),
      scriptFireTargetCache(self_)
{
    // Set the base brain reference in Ai class, it is mandatory
    this->aiBaseBrain = &botBrain;
    // Set the route cache reference in Ai class, it is mandatory
    // Use a separate instance of a route cache
    this->routeCache = AiAasRouteCache::NewInstance();
    self->r.client->movestyle = Skill() > 0.33f ? GS_NEWBUNNY : GS_CLASSICBUNNY;
    SetTag(self->r.client->netname);
}
예제 #9
0
CXML_Element::CXML_Element(const CFX_ByteStringC& qTagName)
    : m_pParent(NULL)
    , m_QSpaceName()
    , m_TagName()
    , m_AttrMap()
{
    SetTag(qTagName);
}
static void BM_SpanSetTag1(benchmark::State& state) {
  auto tracer = MakeTracer();
  assert(tracer != nullptr);
  for (auto _ : state) {
    auto span = tracer->StartSpan("abc123");
    span->SetTag("abc", "123");
  }
}
예제 #11
0
int Higgs::Train(boca::Event const& event, PreCuts const& pre_cuts, Tag tag)
{
    INFO0;
    auto leptons = event.Leptons();
    return SaveEntries(Doublets(event, [&](Doublet & doublet) {
        return SetTag(doublet, leptons, pre_cuts, tag);
    }), Particles(event), tag, Id::higgs);
}
예제 #12
0
CXML_Element::CXML_Element(FX_BSTR qTagName)
    : m_pParent(NULL)
    , m_QSpaceName()
    , m_TagName()
    , m_AttrMap()
{
    SetTag(qTagName);
}
예제 #13
0
// ==============================  INPUT HANDLING  ========================================
long TpartEditForm::DoControlClick( long arg, void *ptr )
{
#ifdef __MWERKS__
	#pragma unused(ptr)
#endif
	tag_entry* e;
	tag new_id;
	
	switch( arg )
	{
		case 11801:	// Choose a tag
			new_id = pick_tag_of_type('spri', GetTag( 11801 ), fEntry );
			if(new_id != 0) SetTag( 11801, 'spri', new_id );
		break; 
		
		case 11802:	// Open tag window
			e = get_entry('spri', GetTag( 11801 ) );
			if(e) TRevengeApp::OpenItem( e );
		break;
		
		case 11805:	// Choose a tag
			new_id = pick_tag_of_type('amso', GetTag( 11805 ), fEntry );
			if(new_id != 0) SetTag( 11805, 'amso', new_id );
		break; 
		
		case 11806:	// Open tag window
			e = get_entry('amso', GetTag( 11805 ) );
			if(e) TRevengeApp::OpenItem( e );
		break;
		
		case 11807:	// Choose a tag
			new_id = pick_tag_of_type('lpgr', GetTag( 11807 ), fEntry );
			if(new_id != 0) SetTag( 11807, 'lpgr', new_id );
		break; 
		
		case 11808:	// Open tag window
			e = get_entry('lpgr', GetTag( 11807 ) );
			if(e) TRevengeApp::OpenItem( e );
		break;
		
		default:
			return -1;
	}
	return 0;
}
예제 #14
0
void MediumRock::Start()
{
	SetGravity(0.0f);
	//SetVelocity(0.0f,0.0f);
	SetTag("Rock");
	SetState(NormalState);
	//SetTrigger(true);
	collisionBox->ApplyTorque(1.0f, true);
}
예제 #15
0
int P4ClientAPI::SetTagged( int enable )
{
    if( enable )
	SetTag();
    else
	ClearTag();
	
    return 0;
}
예제 #16
0
CNullTypeInfo::CNullTypeInfo(void)
{
    SetTag(CAsnBinaryDefs::eNull);
    SetCreateFunction(&CNullFunctions::Create);
    SetReadFunction(&CNullFunctions::Read);
    SetWriteFunction(&CNullFunctions::Write);
    SetCopyFunction(&CNullFunctions::Copy);
    SetSkipFunction(&CNullFunctions::Skip);
}
예제 #17
0
//-----------------------------------------------------------------------------
// Purpose: 
// Input  : from - 
//-----------------------------------------------------------------------------
CPhonemeTag::CPhonemeTag( const CPhonemeTag& from ) :
	BaseClass( from )
{
	SetStartAndEndBytes( from.GetStartByte(), from.GetEndByte() );

	SetSelected( from.GetSelected() );

	m_szPhoneme = NULL;
	SetTag( from.GetTag() );
}
예제 #18
0
void CScriptSystem::PushFuncParam(void* object, int scriptTag)
{
    if (m_nTempArg == -1)
    {
        return;
    }

    *(void**)lua_newuserdata(m_pLS, 4) = object;
    SetTag(m_pLS, scriptTag);
    m_nTempArg++;
}
예제 #19
0
GameObject::GameObject(PersistentData& storageData):mGame(Game::GetInstance()), mOwner(0),mLayerID(0)
{
	/*mID = */mGame.RegisterGameObject(this);
	std::string s = storageData.GetProperty("Tag");
	SetTag(s);	
	mActive = storageData.GetPropertyB("Active");
	std::string layer = storageData.GetProperty("Layer");
	if(layer != "")
	{
		mLayerID = LayerManager::GetInstance().GetLayerID(layer);
	}
}
예제 #20
0
void CContainerTypeInfo::InitContainerTypeInfoFunctions(void)
{
    SetTag(m_RandomOrder ? CAsnBinaryDefs::eSetOf : CAsnBinaryDefs::eSequenceOf);
    SetReadFunction(&ReadContainer);
    SetWriteFunction(&WriteContainer);
    SetCopyFunction(&CopyContainer);
    SetSkipFunction(&SkipContainer);
    m_InitIteratorConst = &CContainerTypeInfoFunctions::InitIteratorConst;
    m_InitIterator = &CContainerTypeInfoFunctions::InitIterator;
    m_AddElement = &CContainerTypeInfoFunctions::AddElement;
    m_AddElementIn = &CContainerTypeInfoFunctions::AddElementIn;
    m_GetElementCount = &CContainerTypeInfoFunctions::GetElementCount;
}
예제 #21
0
cNamedMonster::cNamedMonster(const std::string& _name, const D3DXVECTOR3& _pos, cIState* _pState)
{
	this->AddRef();
	SetName(_name);
	m_chrSkinnedMesh = new cSkinnedMesh;
	SetVBaseDir(D3DXVECTOR3(0, 0, -1));
	SetVDir(D3DXVECTOR3(0, 0, -1));
	SetVPos(_pos);

	SetTag(g_pGameManager->FindObjectType("monster"));
	g_pObjectManager->AddObject(this);

	SetStateMachine(new cBossMonsterFSM(this, _pState));
}
예제 #22
0
//-----------------------------------------------------------------------------
// Purpose: 
// Input  : *phoneme - 
//-----------------------------------------------------------------------------
CPhonemeTag::CPhonemeTag( const char *phoneme )
{
	SetStartAndEndBytes( 0, 0 );

	SetStartTime( 0.0f );
	SetEndTime( 0.0f );

	SetSelected( false );

	SetPhonemeCode( 0 );

	m_szPhoneme = NULL;
	SetTag( phoneme );
}
예제 #23
0
// データ挿入
void push(int value){
    __int128 newNode = 0;
    __int128 oldNode = 0;
    uint64_t newTag = 0;
    uint64_t oldTag = 0;

    /*--------allocate-------*/
    SetPtr(newNode, (Node*)malloc(sizeof(Node)));
    GetPtr(newNode)->value = value;

    /*--------タグ更新-------*/
    do{
        oldTag = tagCnt;
        newTag = oldTag + 1;
    }while(!__sync_bool_compare_and_swap(&tagCnt, oldTag, newTag));
    SetTag(newNode, newTag);
    SetTag(GetPtr(newNode)->ptr, newTag);

    /*--------head更新-------*/
    do{
        oldNode = head;
        SetPtr(GetPtr(newNode)->ptr, GetPtr(oldNode));
    }while(!__sync_bool_compare_and_swap(&head, oldNode, newNode));
}
예제 #24
0
파일: hooks.c 프로젝트: PerpetualWar/minqlx
void __cdecl My_G_InitGame(int levelTime, int randomSeed, int restart) {
    G_InitGame(levelTime, randomSeed, restart);

    if (!cvars_initialized) { // Only called once.
        SetTag();
    }
    InitializeCvars();

#ifndef NOPY
    // Only call it if we're loading a completely new game, otherwise it will also
    // be called when people ready up and the game starts.
    if (!restart)
    	NewGameDispatcher();
#endif
}
예제 #25
0
//-----------------------------------------------------------------------------
// Purpose: 
// Input  : *phoneme - 
//-----------------------------------------------------------------------------
CPhonemeTag::CPhonemeTag( const char *phoneme )
{
	m_uiStartByte = 0;
	m_uiEndByte = 0;

	m_flStartTime = 0.0f;
	m_flEndTime = 0.0f;

	m_flVolume = 1.0f;

	m_bSelected = false;

	m_nPhonemeCode = 0;

	SetTag( phoneme );
}
예제 #26
0
cCombatNPC::cCombatNPC(const std::string & _name, const D3DXVECTOR3 & _pos, const D3DXVECTOR3& _vDir, cIState * _pState)
{
	this->AddRef();
	SetName(_name);
	m_chrSkinnedMesh = new cSkinnedMesh;
	m_objSkinnedMesh = new cWeaponSkinnedMesh;
	SetVBaseDir(D3DXVECTOR3(0, 0, -1));
	SetVDir(D3DXVECTOR3(0, 0, -1));
	SetVPos(_pos);
	SetVDir(_vDir);

	SetTag(g_pGameManager->FindObjectType("combatnpc"));
	g_pObjectManager->AddObject(this);

	SetStateMachine(new cCombatNPCFSM(this, _pState));
}
ECode CPagedViewIcon::ApplyFromApplicationInfo(
    /* [in] */ IApplicationInfo* info,
    /* [in] */ Boolean scaleUp,
    /* [in] */ IPagedViewIconPressedCallback* cb)
{
    ApplicationInfo* _info = (ApplicationInfo*)info;
    mIcon = _info->mIconBitmap;
    mPressedCallback = cb;
    AutoPtr<FastBitmapDrawable> drawable = new FastBitmapDrawable();
    drawable->constructor(mIcon);
    SetCompoundDrawablesWithIntrinsicBounds(NULL, IDrawable::Probe(drawable), NULL, NULL);
    SetText(_info->mTitle);
    if (_info->mContentDescription != NULL) {
        SetContentDescription(_info->mContentDescription);
    }
    return SetTag(info);
}
static void BM_SpanSetTag2(benchmark::State& state) {
  auto tracer = MakeTracer();
  assert(tracer != nullptr);
  for (auto _ : state) {
    auto span = tracer->StartSpan("abc123");
    char key[5];
    key[0] = 'a';
    key[1] = 'b';
    key[2] = 'c';
    key[3] = '0';
    key[4] = '\0';
    for (int i = 0; i < 10; ++i) {
      span->SetTag(opentracing::string_view{key, 4}, "123");
      ++key[3];
    }
  }
}
예제 #29
0
void SSL_HandShakeMessage::PerformActionL(DataStream::DatastreamAction action, uint32 arg1, uint32 arg2)
{
	switch(action)
	{
	case DataStream::KReadAction:
	case DataStream::KWriteAction:
		{
			uint32 step = arg1;
			int record_item_id = (int) arg2;

			if(record_item_id == DataStream_SequenceBase::STRUCTURE_START)
			{
				if(action == DataStream::KWriteAction)
					spec.enable_length = (connstate->version.Major() >= 3);
				else
					length.SetEnableRecord(connstate->version.Major() >= 3);
				dummy.ResetRecord();
				dummy.SetEnableRecord(TRUE);
			}
			
			LoadAndWritableList::PerformActionL(action, step, record_item_id);
			
			if(action == DataStream::KReadAction)
			{
				if(record_item_id == RECORD_TAG)
				{
					if(connstate->version.Major() < 3)
						SetTag((SSL_HandShakeType)(((uint32) GetTag()) | 0x100)); // Convert 8 bit value into the SSL v2 message type
					
					LEAVE_IF_ERROR(SetMessage((SSL_HandShakeType) GetTag()));
				}
				else if(record_item_id == STRUCTURE_FINISHED)
				{
					if(dummy.GetLength() != 0 && GetTag() != SSL_Client_Hello)
						RaiseAlert(SSL_Fatal,SSL_Illegal_Parameter);
				}
			}
		}
		break;
	default: 
		LoadAndWritableList::PerformActionL(action, arg1, arg2);
	}
}
예제 #30
0
void Player::Init()
{
	SetTag("Player");
	SetWidth(c_iPlayerWidth);
	SetHeight(c_iPlayerHeight);
	SetAlive(c_bPlayerAlive);
	SetPosition(c_v2DInitPlayerPos);
	SetSpriteID( CreateSprite( "./images/PlayerShip.png" , GetWidth(), GetHeight(), true));

	eCurrentWeapon = BULLET; //Start with standard Bullets

	m_iBulletTimer = 0;
	m_iMissileTimer = 0;
	m_iLaserTimer = 0;
	m_iBulletArrayPosition = c_iPlayerMaxBullets; // Currently Bullets should be [0] - [7]
	m_iMissileArrayPosition = m_iBulletArrayPosition + c_iPlayerMaxMissiles; // should be [8] - [10]
	m_iLaserArrayPosition = m_iMissileArrayPosition + c_iPlayerMaxLasers; // should be [11] -[21]
	m_iBulletAmmo = c_iPlayerMaxBullets;
	m_iMissileAmmo = c_iPlayerMaxMissiles;
	m_iLaserAmmo = c_iPlayerMaxLasers;

	//Bullets go in list first
	for(int i = c_iPlayerMaxBullets; i > 0; i--)
		 GetProjectiles().push_back(new Bullet);

	//Missiles next
	for(int i = m_iMissileArrayPosition; i > m_iBulletArrayPosition; i--)
		 GetProjectiles().push_back(new Missile);

	//Laser last
	for(int i = m_iLaserArrayPosition; i > m_iMissileArrayPosition; i--)
		 GetProjectiles().push_back(new Laser);

	//Init all owned Projectiles
	for(int i = 0; i <  GetProjectiles().size(); ++i)
	{
		 GetProjectiles()[i]->Init();
	}

	
}