예제 #1
0
        public bool ObjectIsAt(Vector2D position)
        {
            if (IsOutsideOfMap(position))
            {
                return(true);
            }
            if (character.IsAtPosition(position))
            {
                return(true);
            }

            foreach (IDrawable npc in npcs)
            {
                if (npc.IsAtPosition(position))
                {
                    return(true);
                }
            }

            foreach (IDrawable obstacle in obstacles)
            {
                if (obstacle.IsAtPosition(position))
                {
                    return(true);
                }
            }

            foreach (IDrawable store in stores)
            {
                if (store.IsAtPosition(position))
                {
                    return(true);
                }
            }

            return(false);
        }