Exemplo n.º 1
0
        public static void PerformActionTest_NullActionDoesNotThrowExceptions()
        {
            Actionable actionable = new Actionable();

            Assert.That(actionable.Action, Is.Null);
            Assert.DoesNotThrow(() => actionable.PerformAction());
        }
Exemplo n.º 2
0
    void PerformActionOnActionable(Actionable actionable)
    {
        playClip();
        // If we don't have anything, then we can't perform an action
        if (heldItems.Count == 0)
        {
            return;
        }
        // Pass the most appropriate thing that we have in
        else
        {
            Actionable       matchedItem     = null;
            HashSet <string> matchingAttribs = null;

            foreach (Actionable item in heldItems)
            {
                //Debug.Log("Trying " + item.name + " with " + actionable.name + "...");
                matchingAttribs = item.GetAttributes();
                matchingAttribs.IntersectWith(actionable.GetAttributes());
                if (matchingAttribs.Count > 0)
                {
                    matchedItem = item;
                    break;
                }
            }

            if (matchedItem)
            {
                actionable.PerformAction(matchingAttribs, matchedItem, this);
            }
        }
    }
Exemplo n.º 3
0
 void PerformSoloAction(Actionable actionable)
 {
     actionable.PerformAction(this);
 }