Пример #1
0
        /// <summary>
        /// Gets whether this player is next to this thing
        /// or, in the case of containers, any item inside the container.
        /// </summary>
        /// <param name="thing"></param>
        /// <returns></returns>
        public bool IsNextTo(Thing thing)
        {
            if (thing.CurrentPosition == null) {
                Item item = thing.GetEquipableItem();
                if (item != null && item.Parent != null) {
                    Console.WriteLine("in item get final parent");
                    if (IsNextTo(item.GetFinalParent())) {
                        return true;
                    }
                }
            } else {
                Console.WriteLine("currentpos: " + thing.CurrentPosition);
                if (IsNextTo(thing.CurrentPosition)) {
                    return true;
                }
            }

            return false;
        }