示例#1
0
 /// <summary>
 /// Initializes the tag bits.
 /// </summary>
 internal static void Init()
 {
     BASICALLY_IDLE = new TagBits();
     BASICALLY_IDLE.SetTag(GameTags.Idle);
     BASICALLY_IDLE.SetTag(GameTags.RecoveringBreath);
     BASICALLY_IDLE.SetTag(GameTags.MakingMess);
 }
示例#2
0
 /// <summary>
 /// Initializes the tag masks used for collision.
 /// </summary>
 internal static void Init()
 {
     COLLIDE_WITH = new TagBits();
     COLLIDE_WITH.SetTag(GameTags.Creature);
     COLLIDE_WITH.SetTag(GameTags.Minion);
     COLLIDE_WITHOUT = new TagBits();
     COLLIDE_WITHOUT.SetTag(GameTags.Dead);
     COLLIDE_WITHOUT.SetTag(GameTags.Dying);
 }
示例#3
0
 /// <summary>
 /// Initializes the tag bits.
 /// </summary>
 internal static void InitTagBits()
 {
     CONFINED.SetTag(GameTags.Creatures.Confined);
     OVERCROWDED.SetTag(GameTags.Creatures.Overcrowded);
     CRAMPED.SetTag(GameTags.Creatures.Expecting);
     EGG.SetTag(GameTags.Egg);
     IMMUNE_CONFINEMENT.SetTag(GameTags.Creatures.Burrowed);
     IMMUNE_CONFINEMENT.SetTag(GameTags.Creatures.Digger);
 }
示例#4
0
    private void DropExcessIngredients(Storage storage)
    {
        TagBits search_tags = default(TagBits);

        search_tags.Or(ref keepAdditionalTags);
        for (int i = 0; i < recipe_list.Length; i++)
        {
            ComplexRecipe complexRecipe = recipe_list[i];
            if (IsRecipeQueued(complexRecipe))
            {
                ComplexRecipe.RecipeElement[] ingredients = complexRecipe.ingredients;
                foreach (ComplexRecipe.RecipeElement recipeElement in ingredients)
                {
                    search_tags.SetTag(recipeElement.material);
                }
            }
        }
        for (int num = storage.items.Count - 1; num >= 0; num--)
        {
            GameObject gameObject = storage.items[num];
            if (!((UnityEngine.Object)gameObject == (UnityEngine.Object)null))
            {
                PrimaryElement component = gameObject.GetComponent <PrimaryElement>();
                if (!((UnityEngine.Object)component == (UnityEngine.Object)null) && (!keepExcessLiquids || !component.Element.IsLiquid))
                {
                    KPrefabID component2 = gameObject.GetComponent <KPrefabID>();
                    if ((bool)component2 && !component2.HasAnyTags(ref search_tags))
                    {
                        storage.Drop(gameObject, true);
                    }
                }
            }
        }
    }
示例#5
0
 private void LaunderTagBits()
 {
     if (dirtyTagBits)
     {
         tagBits.ClearAll();
         foreach (Tag tag in tags)
         {
             tagBits.SetTag(tag);
         }
         dirtyTagBits = false;
     }
 }