本文整理匯總了C#中System.Entity.GetTags方法的典型用法代碼示例。如果您正苦於以下問題:C# Entity.GetTags方法的具體用法?C# Entity.GetTags怎麽用?C# Entity.GetTags使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Entity
的用法示例。
在下文中一共展示了Entity.GetTags方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: IsRecordableCard
public static bool IsRecordableCard(Entity entity)
{
var tagSet = entity.GetTags();
int tagValue;
if (tagSet.TryGetValue((int)GAME_TAG.CANT_PLAY, out tagValue))
return false;
if (tagSet.TryGetValue((int)GAME_TAG.REVEALED, out tagValue) && tagValue == 0)
return false;
if (tagSet.TryGetValue((int)GAME_TAG.CARDTYPE, out tagValue))
{
var cardType = (TAG_CARDTYPE)tagValue;
return cardType != TAG_CARDTYPE.HERO && cardType != TAG_CARDTYPE.HERO_POWER;
}
return true;
}
示例2: AddEntity
internal void AddEntity(Entity mEntity)
{
_entities.Add(mEntity);
foreach (var tag in mEntity.GetTags())
{
if (!_taggedEntities.ContainsKey(tag)) _taggedEntities.Add(tag, new HashSet<Entity>());
_taggedEntities[tag].Add(mEntity);
}
foreach (var component in mEntity.GetComponents())
{
var componentType = component.GetType();
if (!_componentEntities.ContainsKey(componentType))
{
_componentEntities.Add(componentType, new HashSet<Entity>());
_components.Add(componentType, new HashSet<Component>());
}
_componentEntities[componentType].Add(mEntity);
_components[componentType].Add(component);
}
}
示例3: SaveEntity
private static void SaveEntity(Entity entity, BinaryWriter writer)
{
SaveArray(entity.GetComponentsForSaving(), writer);
SaveArray(entity.GetTags(), writer);
SaveEntityBehaviors(entity, writer);
if (entity is DrawableEntity)
SaveDrawableEntityDrawBehaviors(entity as DrawableEntity, writer);
}
示例4: RemoveEntity
internal void RemoveEntity(Entity mEntity)
{
_entities.Remove(mEntity);
foreach (var tag in mEntity.GetTags()) _taggedEntities[tag].Remove(mEntity);
foreach (var component in mEntity.GetComponents())
{
var componentType = component.GetType();
_componentEntities[componentType].Remove(mEntity);
_components[componentType].Remove(component);
}
}
示例5: IsAvatarAvailable
private static bool IsAvatarAvailable(AvatarSlot avatarSlot, Entity avatar)
{
return avatar.GetTags().Contains(avatarSlot.AvatarName.ToString());
}