示例#1
0
CEC_ConnState_Tag::CEC_ConnState_Tag(EC_DETAIL_LEVEL detail_level) : CECTag(EC_TAG_CONNSTATE,
	(uint8)(
			(theApp->IsConnectedED2K() ? 0x01 : 0x00)
			|
			(theApp->serverconnect->IsConnecting() ? 0x02 : 0x00)
			|
			(theApp->IsConnectedKad() ? 0x04 : 0x00)
			|
			(Kademlia::CKademlia::IsFirewalled() ? 0x08 : 0x00)
			| 
			(Kademlia::CKademlia::IsRunning() ? 0x10 : 0x00)
		))
{
	if (theApp->IsConnectedED2K()) {
		if ( theApp->serverconnect->GetCurrentServer() ) {
			if (detail_level == EC_DETAIL_INC_UPDATE) {
				// Send no full server tag, just the ECID of the connected server
				AddTag(CECTag(EC_TAG_SERVER, theApp->serverconnect->GetCurrentServer()->ECID()));
			} else {
				AddTag(CEC_Server_Tag(theApp->serverconnect->GetCurrentServer(), detail_level));
			}
		}
		AddTag(CECTag(EC_TAG_ED2K_ID, theApp->GetED2KID()));
	} else if (theApp->serverconnect->IsConnecting()) {
		AddTag(CECTag(EC_TAG_ED2K_ID, 0xffffffff));
	}

	AddTag(CECTag(EC_TAG_CLIENT_ID, theApp->GetID()));	
}
示例#2
0
//
// Friend
//
CEC_Friend_Tag::CEC_Friend_Tag(const CFriend* Friend, CValueMap* valuemap) : CECTag(EC_TAG_FRIEND, Friend->ECID())
{
	AddTag(EC_TAG_FRIEND_NAME,	Friend->GetName(), valuemap);
	AddTag(EC_TAG_FRIEND_HASH,	Friend->GetUserHash(), valuemap);
	AddTag(EC_TAG_FRIEND_IP,	Friend->GetIP(), valuemap);
	AddTag(EC_TAG_FRIEND_PORT,	Friend->GetPort(), valuemap);
	const CClientRef& linkedClient = Friend->GetLinkedClient();
	AddTag(EC_TAG_FRIEND_CLIENT, linkedClient.IsLinked() ? linkedClient.ECID() : 0, valuemap);
}
CEC_Category_Tag::CEC_Category_Tag(uint32 cat_index, wxString name, wxString path,
			wxString comment, uint32 color, uint8 prio) : CECTag(EC_TAG_CATEGORY, cat_index)
{
	AddTag(CECTag(EC_TAG_CATEGORY_PATH, path));
	AddTag(CECTag(EC_TAG_CATEGORY_COMMENT, comment));
	AddTag(CECTag(EC_TAG_CATEGORY_COLOR, color));
	AddTag(CECTag(EC_TAG_CATEGORY_PRIO, prio));
	AddTag(CECTag(EC_TAG_CATEGORY_TITLE, name));
}
示例#4
0
	STagGroup::STagGroup( ){ 
		//AddTag("/>",&CXML::parseEndEmptyElment);
		AddTag("<![CDATA[",&CXML::parseCDataBegin);
		AddTag("<!--",&CXML::parseComment);
		AddTag("</",&CXML::parseEndElment);        
		AddTag("<?",&CXML::parseDeclaration);
		AddTag("<",&CXML::parseLf);
		//AddTag(">",&CXML::parseRf);
		//AddTag("]]>",&CXML::parseCDataEnd);
	}
示例#5
0
/*-----------------------------------------------------------------------------
 Data Members
------------------------------------------------------------------------------*/
PROTECTED PacketMgrInputBufferInfo packetMgrInputBuffer;
PROTECTED PacketMgrOutputBufferInfo packetMgrOutputBuffer;

PROTECTED pLIB_ARRAY_LIST_List packetMgrTagListenerList;


//*****************************************************************************
//
// Exported Functions
//
//*****************************************************************************


//****************************************************************************/
PUBLIC Result PACKET_MGR_Init( void )
{
    Result result = PACKET_MGR_RESULT(SUCCESS);

    LOG_Printf("Initializing Packet Mgr component\n");

    ZeroMemory(&packetMgrInputBuffer, sizeof(PacketMgrInputBufferInfo));
    ZeroMemory(&packetMgrOutputBuffer, sizeof(PacketMgrOutputBufferInfo));
    SetMemory(&packetMgrInputBuffer.PacketInfo, PACKET_NULL_INDEX, sizeof(PacketMgrPacketInfo)*PACKET_MGR_INPUT_MAX_PACKETS);

    packetMgrTagListenerList = NULL;


    if( RESULT_IS_ERROR(result, OS_CREATE_MUTEX(&packetMgrInputBuffer.Mutex)) )
    {
        LOG_Printf("Failed to create read buffer mutex\n");
    }
    else if( RESULT_IS_ERROR(result, OS_CREATE_MUTEX(&packetMgrOutputBuffer.Mutex)) )
    {
        LOG_Printf("Failed to create write buffer mutex\n");
    }
    else if( RESULT_IS_ERROR(result, COMPOSITE_USB_RegisterReadVirComCallback(VirComReadCallback)) )
    {
        LOG_Printf("Failed to register virtual com read callback\n");
    }
    else if( RESULT_IS_ERROR(result, PacketMgrCreateTask()) )
    {
        LOG_Printf("Failed to create the packet mgr task\n");
    }
    else if( (packetMgrTagListenerList = LIB_ARRAY_LIST_CreateList(sizeof(PacketMgrTagListenerInfo), 1)) == NULL )
    {
        result = PACKET_MGR_RESULT(CREATE_LIS_LIST_FAIL);
        LOG_Printf("Failed to create array list\n");
    }

    return result;
}


//****************************************************************************/
PUBLIC Result PACKET_MGR_PowerUp( void )
{
    Result result = PACKET_MGR_RESULT_INIT();

    return result;
}


//****************************************************************************/
PUBLIC Result PACKET_MGR_PowerDown( void )
{
    Result result = PACKET_MGR_RESULT_INIT();

    return result;
}


//****************************************************************************/
PUBLIC Result PACKET_MGR_AddPacket(pLIB_XML_Tag PacketData, uint32 PacketId)
{
    Result result = PACKET_MGR_RESULT(SUCCESS);
    uint32 packetSize, dataSize, pi, byteCount;

    dataSize = strnlen(PacketData->Data, PACKET_MGR_OUTPUT_BUFFER_SIZE);
    packetSize = strnlen(PacketData->Tag, LIB_XML_MAX_TAG_LEN)*2 + 5 + dataSize;
    pi = packetMgrOutputBuffer.NextPacketIndex;


    OS_TAKE_MUTEX(packetMgrOutputBuffer.Mutex);


    if( (packetMgrOutputBuffer.BytesUsed + packetSize <= PACKET_MGR_OUTPUT_BUFFER_SIZE) &&
            (packetMgrOutputBuffer.PacketsAvailable < PACKET_MGR_OUTPUT_MAX_PACKETS))
    {
        packetMgrOutputBuffer.PacketInfo[pi].StartIndex = packetMgrOutputBuffer.FirstFreeIndex;

        AddTag(PacketData->Tag, TRUE);

        if( packetMgrOutputBuffer.FirstFreeIndex + dataSize <= PACKET_MGR_OUTPUT_BUFFER_SIZE )
        {
            CopyMemory(&packetMgrOutputBuffer.Buffer[packetMgrOutputBuffer.FirstFreeIndex], PacketData->Data, dataSize);
        }
        else
        {
            byteCount = PACKET_MGR_OUTPUT_BUFFER_SIZE - packetMgrOutputBuffer.FirstFreeIndex;
            CopyMemory(&packetMgrOutputBuffer.Buffer[packetMgrOutputBuffer.FirstFreeIndex], PacketData->Data, byteCount);

            packetMgrOutputBuffer.FirstFreeIndex = dataSize - byteCount;
            CopyMemory(packetMgrOutputBuffer.Buffer, &((uint8*)PacketData->Data)[byteCount], packetMgrOutputBuffer.FirstFreeIndex);
        }

        AddTag(PacketData->Tag, FALSE);

        packetMgrOutputBuffer.PacketInfo[pi].Id = PacketId;
        packetMgrOutputBuffer.PacketInfo[pi].EndIndex = packetMgrOutputBuffer.FirstFreeIndex;
        packetMgrOutputBuffer.NextPacketIndex = (packetMgrOutputBuffer.NextPacketIndex+1)%PACKET_MGR_OUTPUT_MAX_PACKETS;
        packetMgrOutputBuffer.BytesUsed += packetSize;
    }
    else
    {
        result = PACKET_MGR_RESULT(OUT_BUF_FULL);
        LOG_Printf("Warning: PacketMgr Input Buffer Full\n");
    }

    OS_GIVE_MUTEX(packetMgrOutputBuffer.Mutex);


    return result;
}
示例#6
0
	Ball::Ball() : Entity(), texture(NULL)
	{
		AddTag("Ball");
		SetCollider(new RectangleCollider(25.0f, 25.0f));
		//Collision::AddRectangleCollider(this, 25.0f, 25.0f);
		velocity = Vector2::right * 200.0f;
	}
示例#7
0
	static long SubRead ( LFA_FileRef inFileRef, RiffState & inOutRiffState, long parentid, UInt32 parentlen, UInt64 & inOutPosition )
	{
		long tag;
		long subtype = 0;
		long parentnum;
		UInt32 len, total, childlen;
		UInt64 oldpos;
	
		total = 0;
		parentnum = (long) inOutRiffState.tags.size() - 1;
		
		UInt64 maxOffset = inOutPosition + parentlen;
	
		while ( parentlen > 0 ) {

			oldpos = inOutPosition;
			ReadTag ( inFileRef, &tag, &len, &subtype, inOutPosition, maxOffset );
			AddTag ( inOutRiffState, tag, len, inOutPosition, parentid, parentnum, subtype );
			len += (len & 1); //padding byte

			if ( subtype == 0 ) {
				childlen = 8 + len;
			} else {
				childlen = 12 + SubRead ( inFileRef, inOutRiffState, subtype, len, inOutPosition );
			}

			if ( parentlen < childlen ) parentlen = childlen;
			parentlen -= childlen;
			total += childlen;

		}
	
		return total;
	
	}
示例#8
0
/*
 * ScanAsm - scan an asm file
 */
void ScanAsm( void )
{
    char        buff[MAX_STR];
    char        token[MAX_STR];
    char        *buffptr;
    int         i;

    while( GetString( buff, sizeof( buff ) ) ) {

        buffptr = buff;
        while( isspace( *buffptr ) ) {
            buffptr++;
        }
        if( *buffptr == '\0' ) {
            continue;
        }
        i = 0;
        while( IsTokenChar( *(unsigned char *)buffptr ) ) {
            token[i++] = *buffptr++;
        }
        if( i == 0 ) {
            continue;
        }
        token[i] = '\0';
        while( isspace( *buffptr ) ) {
            buffptr++;
        }
        if( MyStricmp( &buffptr, "proc" ) ) {
            continue;
        }
        RecordCurrentLineData();
        AddTag( token );
    }

} /* ScanAsm */
示例#9
0
int addDataFieldFromNDfield(NDskel *skl,NDfield *f, const char *name, int periodic)
{
  int done=1;
  if (f->ndims==1)
    {
      if (f->dims[0] == skl->nnodes)
	AddTagFromVal(skl,NULL,f,name,periodic);
      else if (f->dims[0] == skl->nsegs)
	AddTagFromVal(skl,f,NULL,name,periodic);
      else done=0;
    }
  else if ((f->ndims==2)&&(f->dims[1]==2)&&(f->dims[0]==skl->nsegs))
    {
      AddTagFromVal(skl,f,NULL,name,periodic);	  
    }
  else if (f->ndims==skl->ndims)
    {
      AddTag(skl,f,name,periodic);
    }
  else done=0;
  
  if (!done)
    {
      fprintf(stderr,"ERROR adding data field from NDfield.\n");
      fprintf(stderr,"   input field has wrong dimensions.\n");
      fprintf(stderr,"   should be a grid, with dims [%ld] [%ld] [%ld,%ld] or ndims=%ld.\n",
	      (long)skl->nnodes,(long)skl->nsegs,(long)skl->nsegs,(long)2,(long)skl->ndims);
      return -1;
    }

  return 0;
}
示例#10
0
CEC_Category_Tag::CEC_Category_Tag(uint32 cat_index, EC_DETAIL_LEVEL detail_level) : CECTag(EC_TAG_CATEGORY, cat_index)
{
	Category_Struct *cat = theApp->glob_prefs->GetCategory(cat_index);
	switch (detail_level) {
		case EC_DETAIL_UPDATE:
		case EC_DETAIL_INC_UPDATE:
		case EC_DETAIL_WEB:
		case EC_DETAIL_FULL:
			AddTag(CECTag(EC_TAG_CATEGORY_PATH, cat->path.GetRaw()));
			AddTag(CECTag(EC_TAG_CATEGORY_COMMENT, cat->comment));
			AddTag(CECTag(EC_TAG_CATEGORY_COLOR, (uint32)cat->color));
			AddTag(CECTag(EC_TAG_CATEGORY_PRIO, cat->prio));
		case EC_DETAIL_CMD:
			AddTag(CECTag(EC_TAG_CATEGORY_TITLE, cat->title));
		}
}
示例#11
0
/* Starts timer for given tag. If it does not exist yet,
 it is added.

  Note: 1. The tag may not be nested with the same name
        2. The tag may not equal "" */
void ProfileStart (char* str_tag) {
  entry_t* p_entry ;
  /* One the first call, we must initialize the profiler. */
  if (!g_init) {
    Init () ;
  }
  /* Test for "" */
  if (*str_tag == '\0') {
    fprintf (stdout, "ERROR in ProfileStart: a tag may not be \"\". Call is denied.") ; 
    return ;
  }
  /* Search the entry with the given name */
  p_entry = LookupTag (str_tag) ;
  if (!p_entry) {
    /* New tag, add it*/
    p_entry = AddTag (str_tag) ;
    if (!p_entry) {
      fprintf (stdout, "WARNING in ProfileStart: no more space to store the tag (\"%s\"). Increase NUM_TAGS in \"profile.h\". Call is denied.\n", str_tag) ;
      return ;
    }    
  }
  /* Check for nesting of equal tag.*/
  if (Nested (str_tag)) {
    fprintf (stdout, "ERROR in ProfileStart: nesting of equal tags not allowed (\"%s\"). Call is denied.\n", str_tag) ;
    return ;
  }
  /* Increase the number of hits */
  ++p_entry->i_calls ;
  /* Set the start time */
  p_entry->start_time = clock () ;
  p_entry->i_stopped = 0 ;
}
示例#12
0
void CRoomTemplate::LoadFromKeyValues( const char *pRoomName, KeyValues *pKeyValues )
{
    m_nTilesX = pKeyValues->GetInt( "TilesX", 1 );
    m_nTilesY = pKeyValues->GetInt( "TilesY", 1 );
    SetSpawnWeight( pKeyValues->GetInt( "SpawnWeight", MIN_SPAWN_WEIGHT ) );

    SetFullName( pRoomName );

    Q_strncpy( m_Description, pKeyValues->GetString( "RoomTemplateDescription", "" ), m_nMaxDescriptionLength );
    Q_strncpy( m_Soundscape, pKeyValues->GetString( "Soundscape", "" ), m_nMaxSoundscapeLength );

    SetTileType( pKeyValues->GetInt( "TileType", ASW_TILETYPE_UNKNOWN ) );

    m_Tags.RemoveAll();

    // search through all the exit subsections
    KeyValues *pkvSubSection = pKeyValues->GetFirstSubKey();
    bool bClearedExits = false;
    while ( pkvSubSection )
    {
        // mission details
        if ( Q_stricmp(pkvSubSection->GetName(), "EXIT")==0 )
        {
            if ( !bClearedExits )
            {
                // if we haven't cleared previous exits yet then do so now
                m_Exits.PurgeAndDeleteElements();
                bClearedExits = true;
            }
            CRoomTemplateExit *pExit = new CRoomTemplateExit();
            pExit->m_iXPos = pkvSubSection->GetInt("XPos");
            pExit->m_iYPos = pkvSubSection->GetInt("YPos");
            pExit->m_ExitDirection = (ExitDirection_t) pkvSubSection->GetInt("ExitDirection");
            pExit->m_iZChange = pkvSubSection->GetInt("ZChange");
            Q_strncpy( pExit->m_szExitTag, pkvSubSection->GetString( "ExitTag" ), sizeof( pExit->m_szExitTag ) );
            pExit->m_bChokepointGrowSource = !!pkvSubSection->GetInt("ChokeGrow", 0);

            // discard exits outside the room bounds
            if ( pExit->m_iXPos < 0 || pExit->m_iYPos < 0 || pExit->m_iXPos >= m_nTilesX || pExit->m_iYPos >= m_nTilesY )
            {
                delete pExit;
            }
            else
            {
                m_Exits.AddToTail(pExit);
            }
        }
        else if ( Q_stricmp(pkvSubSection->GetName(), "Tags")==0 && TagList() )
        {
            for ( KeyValues *sub = pkvSubSection->GetFirstSubKey(); sub != NULL; sub = sub->GetNextKey() )
            {
                if ( !Q_stricmp( sub->GetName(), "tag" ) )
                {
                    AddTag( sub->GetString() );
                }
            }
        }
        pkvSubSection = pkvSubSection->GetNextKey();
    }
}
示例#13
0
	bool MarkChunkAsPadding ( LFA_FileRef inFileRef, RiffState & inOutRiffState, long riffType, long tagID, long subtypeID )
	{
		UInt32 len;
		UInt64 pos;
		atag tag;
	
		try {
	
			bool found = FindChunk ( inOutRiffState, tagID, riffType, subtypeID, NULL, &len, &pos );
			if ( ! found ) return false;
	
			if ( subtypeID != 0 ) {
				pos -= 12;
			} else {
				pos -= 8;
			}

			tag.id = MakeUns32LE ( ckidPremierePadding );
			LFA_Seek ( inFileRef, pos, SEEK_SET );
			LFA_Write ( inFileRef, &tag, 4 );
	
			pos += 8;
			AddTag ( inOutRiffState, ckidPremierePadding, len, pos, 0, 0, 0 );
	
		} catch(...) {
	
			return false;	// If a write fails, it throws, so we return false.
	
		}
	
		return true;
	}
示例#14
0
	//初期化
	void FixedBox::OnCreate() {
		auto PtrTransform = GetComponent<Transform>();

		PtrTransform->SetScale(m_Scale);
		PtrTransform->SetRotation(m_Rotation);
		PtrTransform->SetPosition(m_Position);
		//OBB衝突j判定を付ける
		auto PtrColl = AddComponent<CollisionObb>();
		PtrColl->SetFixed(true);

		//タグをつける
		AddTag(L"FixedBox");

		//影をつける
		auto ShadowPtr = AddComponent<Shadowmap>();
		ShadowPtr->SetMeshResource(L"DEFAULT_CUBE");

		auto PtrDraw = AddComponent<BcPNTStaticDraw>();
		PtrDraw->SetFogEnabled(true);
		PtrDraw->SetMeshResource(L"DEFAULT_CUBE");
		PtrDraw->SetOwnShadowActive(true);
		PtrDraw->SetTextureResource(L"SKY_TX");


	}
示例#15
0
	// T H E   P L A Y E R (entity)
	Player::Player(int x, int y) : Entity(), 
		FRICTION_GROUND(800),
		FRICTION_AIR(400),
		GRAVITY(300),
                JUMP(120.0f),
                MAXSPEED_GROUND(60.0f),
		MAXSPEED_AIR(100.0f),
		ACCELERATION(800),
                WALLJUMP(160.0f),
		doubleJump(false),
		cling(0),
		onGround(false)
	{
		position = Vector2(x, y);

		AddTag("PLAYER");
		SetCollider(new RectangleCollider(8, 8));

		sprite = new SpriteAnimation("player.png", FILTER_NONE, 8, 8);
		sprite->Add("stand", 0, 0, 0);
		sprite->Add("run", 0, 3, 12.0f);
		sprite->Add("jumpUp", 8, 8, 0);
		sprite->Add("jumpDown", 9, 9, 0);
		sprite->Play("run");

		SetLayer(-1);
		SetGraphic(sprite);

		direction = true;
	}
示例#16
0
	// T H E   W A L L (entity)
	Wall::Wall(int x, int y) : Entity()
	{
		position = Vector2(x, y);
		AddTag("WALL");
		SetCollider(new RectangleCollider(8, 8));
		SetLayer(5);
	}
void TurretManager::CreateNodes()
{
	for (int i = 0; i < 6; i++)
	{
		auto node = std::shared_ptr<Node>(new Node(1, i, orbit01Angle, node01Texture));
		nodes.emplace_back(node);
		AddChild(node);
		node->AddTag("Node");
	}
	for (int i = 0; i < 12; i++)
	{
		auto node = std::shared_ptr<Node>(new Node(2, i, orbit02Angle, node01Texture));
		nodes.emplace_back(node);
		AddChild(node);
		node->AddTag("Node2");
	}
}
示例#18
0
void CECTag::AddTag(ec_tagname_t name, uint64_t data, CValueMap* valuemap)
{
	if (valuemap) {
		valuemap->CreateTag(name, data, this);
	} else {
		AddTag(CECTag(name, data));
	}
}
示例#19
0
void CECTag::AddTag(ec_tagname_t name, const CMD4Hash& data, CValueMap* valuemap)
{
	if (valuemap) {
		valuemap->CreateTag(name, data, this);
	} else {
		AddTag(CECTag(name, data));
	}
}
示例#20
0
	void Player::OnCreate() {
		vector<VertexPositionNormalTexture> vertices;
		vector<uint16_t> indices;
		MeshUtill::CreateSphere(1.0f, m_Division, vertices, indices);
		//メッシュの作成(変更できない)
		m_SphereMesh = MeshResource::CreateMeshResource(vertices, indices, false);
		//タグの追加
		AddTag(L"Player");
	}
示例#21
0
Wall::Wall(Vector2 pos, float w, float h)
    : Entity()
{
    position = pos;
    AddTag("Wall");
    SetCollider(new RectangleCollider(w, h));
    this->width = w;
    this->height = h;
}
示例#22
0
FDDCScopeStatHelper::FDDCScopeStatHelper(const TCHAR* CacheKey, const FName& FunctionName) : bHasParent(false)
{

	if (DDCStats::GetCookingStats() == nullptr)
		return;

	DDCStats::FDDCStatsTLSStore* TLSStore = (DDCStats::FDDCStatsTLSStore*)FPlatformTLS::GetTlsValue(DDCStats::CookStatsFDDCStatsTLSStore);
	if (TLSStore == nullptr)
	{
		TLSStore = new DDCStats::FDDCStatsTLSStore();
		FPlatformTLS::SetTlsValue(DDCStats::CookStatsFDDCStatsTLSStore, TLSStore);
	}

	TransactionGuid = TLSStore->GenerateNewTransactionName();


	FString Temp;
	AddTag(FunctionName, Temp);

	if (TLSStore->RootScope == nullptr)
	{
		TLSStore->RootScope = this;
		bHasParent = false;

		static const FName NAME_CacheKey = FName(TEXT("CacheKey"));
		AddTag(NAME_CacheKey, FString(CacheKey));
	}
	else
	{
		static const FName NAME_Parent = FName(TEXT("Parent"));
		AddTag(NAME_Parent, TLSStore->RootScope->TransactionGuid.ToString());

		bHasParent = true;
	}


	static const FName NAME_StartTime(TEXT("StartTime"));
	AddTag(NAME_StartTime, FDateTime::Now().ToString());

	StartTime = FPlatformTime::Seconds();

	// if there is a root scope then we want to put out stuff under a child key of the parent and link to the parent scope
}
示例#23
0
文件: Triangle.cpp 项目: aquach/volt
Triangle::Triangle () {
    AddTag("Triangle");
    SetType("Triangle");

    m_vertexColors[0] = Volt::Color::red;
    m_vertexColors[1] = Volt::Color::green;
    m_vertexColors[2] = Volt::Color::blue;
    m_textureCoords[0].Set(0, 0);
    m_textureCoords[1].Set(1, 0);
    m_textureCoords[2].Set(0, 1);
}
EnemyBulletObject::EnemyBulletObject(sf::Vector2f p_vPos, sf::Vector2f p_vDir, float p_fAcceleration){
	setPosition(p_vPos);
	m_vDir = p_vDir;

	m_fAcceleration = p_fAcceleration;

	m_xpSprite = SpriteMngr::GetSprite("EBullet");

	SetHitbox(CollisionMngr::NewHitbox(this, getPosition(), 4.f, 0));

	AddTag("EBullet");
}
void FGameplayTagContainer::AppendTags(FGameplayTagContainer const& Other)
{
	SCOPE_CYCLE_COUNTER(STAT_FGameplayTagContainer_AppendTags);

	GameplayTags.Reserve(Other.Num());

	//add all the tags
	for(TArray<FGameplayTag>::TConstIterator It(Other.GameplayTags); It; ++It)
	{
		AddTag(*It);
	}
}
void FGameplayTagContainer::AppendMatchingTags(FGameplayTagContainer const& OtherA, FGameplayTagContainer const& OtherB)
{
	SCOPE_CYCLE_COUNTER(STAT_FGameplayTagContainer_AppendMatchingTags);

	for(TArray<FGameplayTag>::TConstIterator It(OtherA.GameplayTags); It; ++It)
	{
		if (OtherB.HasTag(*It, EGameplayTagMatchType::Explicit, EGameplayTagMatchType::IncludeParentTags))
		{
			AddTag(*It);		
		}
	}
}
	void LevelInitPostEntity()
	{
		if ( GameRules()->GetGameMode() == GAMEMODE_CLASSIC && 
				lf_reverse_flags.GetBool() )
		{
			AddTag( REVERSE_CTF_TAG );
		}
		else
		{
			RemoveTag( REVERSE_CTF_TAG );
		}
	}
示例#28
0
	// T H E   C O I N (entity)
	Coin::Coin(int x, int y, Sprite *sprite) : Entity(), collected(false), start(x, y), reset(false)
	{
		position = Vector2(x, y);
		SetLayer(-1);
		SetGraphic(sprite);

		AddTag("COIN");
		SetCollider(new RectangleCollider(8, 8));

		while(Collide("WALL"))
		{
			position = Vector2(((int) rand() % 160 / 8) * 8 + 4, ((int) rand() % 120 / 8) * 8 + 4);
			start = Vector2(position.x, position.y);
		}
	}
const COXRegExpression& COXRegExpression::operator=(const COXRegExpression& regExpression)
{
	ASSERT_VALID(&regExpression);
	RemoveAll();
	for (int n=0; n<regExpression.GetTagCount();n++)
		AddTag(regExpression.GetTag(n)->nType, &regExpression.GetTag(n)->sValue,
			regExpression.GetTag(n)->nMin, regExpression.GetTag(n)->nMax);
	m_sRule=regExpression.m_sRule;
	m_nNumber=regExpression.m_nNumber;
	m_nError=regExpression.m_nError;
	m_sSpace=regExpression.m_sSpace;
	m_sText=regExpression.m_sText;
	m_nFound=regExpression.m_nFound;
	ASSERT_VALID(this);
	return *this;
}
示例#30
0
void wxHtmlParser::DoParsing(int begin_pos, int end_pos)
{
    if (end_pos <= begin_pos) return;

    wxHtmlTextPieces& pieces = *m_TextPieces;
    size_t piecesCnt = pieces.GetCount();

    while (begin_pos < end_pos)
    {
        while (m_CurTag && m_CurTag->GetBeginPos() < begin_pos)
            m_CurTag = m_CurTag->GetNextTag();
        while (m_CurTextPiece < piecesCnt &&
               pieces[m_CurTextPiece].m_pos < begin_pos)
            m_CurTextPiece++;

        if (m_CurTextPiece < piecesCnt &&
            (!m_CurTag ||
             pieces[m_CurTextPiece].m_pos < m_CurTag->GetBeginPos()))
        {
            // Add text:
            AddText(GetEntitiesParser()->Parse(
                       m_Source.Mid(pieces[m_CurTextPiece].m_pos,
                                    pieces[m_CurTextPiece].m_lng)));
            begin_pos = pieces[m_CurTextPiece].m_pos +
                        pieces[m_CurTextPiece].m_lng;
            m_CurTextPiece++;
        }
        else if (m_CurTag)
        {
            // Add tag:
            if (m_CurTag)
            {
                if (m_CurTag->HasEnding())
                    begin_pos = m_CurTag->GetEndPos2();
                else
                    begin_pos = m_CurTag->GetBeginPos();
            }
            wxHtmlTag *t = m_CurTag;
            m_CurTag = m_CurTag->GetNextTag();
            AddTag(*t);
            if (m_stopParsing)
                return;
        }
        else break;
    }
}