示例#1
0
 protected abstract bool SubInRange(WorldRelativeOrientation ownLocation, Hitbox target, WorldRelativeOrientation targetLocation);
示例#2
0
 protected bool GenericInRange(WorldRelativeOrientation ownLocation, Hitbox target, WorldRelativeOrientation targetLocation)
 {
     throw new NotImplementedException("Generic case not implemented yet.");
 }
示例#3
0
        public virtual List <Item> FindNearbyInterestingItems(InterestingCheck interestCheck, WorldRelativeOrientation orientation, Hitbox range)
        {
            //Handles finding items that an event is observing or interacting with.

            if (range != null)
            {
                //TODO: Use Hitbox to spread to other rooms. Probably something like
                //foreach exit, if range.inRange(source, exit) && forEvent.spread(exit), exit.otherRoom.stuff(...)
                //Also TODO: Probably have alternatives for range that allow the room to account for visability or audibility
            }

            List <Item> foundItems = new List <Item>();

            for (int stop = contents.Count, i = 0; i < stop; i++)
            {
                Item nextItem = contents.Get(i);
                if (range != null && !range.InRange(orientation, nextItem.Size, nextItem.Position.WorldOrientation()))
                {
                    continue;
                }
                if (interestCheck(nextItem))
                {
                    foundItems.Add(nextItem);
                }
            }
            return(foundItems);
        }