Esempio n. 1
0
        public void OnItemOfInterestLeave()
        {
            Visitable visitable = null;

            if (worlditem.Is <Visitable> (out visitable))
            {
                Creature  creature           = null;
                WorldItem lastItemOfInterest = visitable.LastItemOfInterestToLeave;
                WaterTrap waterTrap          = null;
                if (lastItemOfInterest.Is <WaterTrap> (out waterTrap))
                {
                    waterTrap.IntersectingDens.Remove(this);
                }
            }
        }
Esempio n. 2
0
        public void OnItemOfInterestVisit()
        {
            Visitable visitable = null;

            if (worlditem.Is <Visitable> (out visitable))
            {
                Creature  creature           = null;
                ITrap     trap               = null;
                WorldItem lastItemOfInterest = visitable.LastItemOfInterestToVisit;
                WaterTrap waterTrap          = null;
                if (lastItemOfInterest.Is <WaterTrap> (out waterTrap) && !waterTrap.Exceptions.Contains(State.NameOfFish))
                {
                    Debug.Log("Found a water trap");
                    waterTrap.IntersectingDens.SafeAdd(this);
                }
            }
        }
Esempio n. 3
0
        public void OnItemOfInterestVisit()
        {
            //Debug.Log("On item of interest visit");
            Visitable visitable = null;

            if (worlditem.Is <Visitable>(out visitable))
            {
                Creature  creature           = null;
                ITrap     trap               = null;
                WorldItem lastItemOfInterest = visitable.LastItemOfInterestToVisit;
                LandTrap  landTrap           = null;
                WaterTrap waterTrap          = null;
                if (lastItemOfInterest.Is <LandTrap>(out landTrap) && !landTrap.Exceptions.Contains(NameOfCreature))
                {
                    //Debug.Log("Found a land trap");
                    landTrap.IntersectingDens.SafeAdd(this);
                }
                else if (lastItemOfInterest.Is <WaterTrap>(out waterTrap) && !waterTrap.Exceptions.Contains(NameOfCreature))
                {
                    //Debug.Log("Found a water trap");
                    waterTrap.IntersectingDens.SafeAdd(this);
                }
            }
        }