/// <summary>
        /// Initializes a new instance of the <see cref="QuestMapDrawingExtension{TCharacter}"/> class.
        /// </summary>
        /// <param name="questInfo">The quest info.</param>
        /// <param name="hasStartQuestReqs">The <see cref="Func{T,U}"/> used to determine if the user has the
        /// requirements to start a quest.</param>
        /// <param name="hasFinishQuestReqs">The <see cref="Func{T,U}"/> used to determine if the user has the
        /// requirements to finish a quest.</param>
        /// <param name="getQuestProviders">The <see cref="Func{T,U}"/> used to get the quest providers from
        /// a map.</param>
        /// <param name="getQuests">The <see cref="Func{T,U}"/> used to get the quests provided by
        /// a quest provider.</param>
        public QuestMapDrawingExtension(UserQuestInformation questInfo, Func <QuestID, bool> hasStartQuestReqs,
                                        Func <QuestID, bool> hasFinishQuestReqs,
                                        Func <IDrawableMap, IEnumerable <TCharacter> > getQuestProviders,
                                        Func <TCharacter, IEnumerable <QuestID> > getQuests)
        {
            _questInfo          = questInfo;
            _hasStartQuestReqs  = hasStartQuestReqs;
            _hasFinishQuestReqs = hasFinishQuestReqs;
            _getQuestProviders  = getQuestProviders;
            _getQuests          = getQuests;

            _indicatorDrawer = DefaultIndicatorDrawer;
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UserInfo"/> class.
        /// </summary>
        /// <param name="socket">The socket.</param>
        /// <exception cref="ArgumentNullException"><paramref name="socket" /> is <c>null</c>.</exception>
        public UserInfo(INetworkSender socket)
        {
            if (socket == null)
                throw new ArgumentNullException("socket");

            _socket = socket;

            // Create the collections for tracking if quest requirements statuses
            _hasStartQuestRequirements = new HasQuestRequirementsTracker(SendHasQuestStartRequirements);
            _hasFinishQuestRequirements = new HasQuestRequirementsTracker(SendHasQuestFinishRequirements);

            // Create some other stuff
            _inventory = new Inventory(socket);
            _questInfo = new UserQuestInformationExtended(this);
        }