Example #1
0
        /// <summary>
        /// Determines if this vendor is interested in a good type
        /// </summary>
        /// <param name="goodType">TradeGoods type to check</param>
        public bool IsInterestedIn(TradeGoods goodType, out TradeGoodInterest currentInterest)
        {
            currentInterest = TradeGoodInterest.None;

            if ((interestingGoods & goodType) != 0)
            {
                currentInterest = interestLevelTable[goodType];
                return(true);
            }

            return(false);
        }
Example #2
0
        /// <summary>
        /// Sets the level of interest this vendor has for a given good type
        /// </summary>
        /// <param name="goodType">TradeGoods type to apply the interest level to</param>
        /// <param name="interestLevel">new interest level for the given good type</param>
        public void SetInterestLevel(TradeGoods goodType, TradeGoodInterest interestLevel)
        {
            if (interestLevel == TradeGoodInterest.None)
            {
                interestingGoods &= ~goodType;
            }
            else
            {
                interestingGoods |= goodType;
            }

            interestLevelTable[goodType] = interestLevel;
        }
Example #3
0
		/// <summary>
		/// Sets the level of interest this vendor has for a given good type
		/// </summary>
		/// <param name="goodType">TradeGoods type to apply the interest level to</param>
		/// <param name="interestLevel">new interest level for the given good type</param>
		public void SetInterestLevel( TradeGoods goodType, TradeGoodInterest interestLevel )
		{
			if( interestLevel == TradeGoodInterest.None )
				interestingGoods &= ~goodType;
			else
				interestingGoods |= goodType;

			interestLevelTable[goodType] = interestLevel;
		}
Example #4
0
		/// <summary>
		/// Determines if this vendor is interested in a good type
		/// </summary>
		/// <param name="goodType">TradeGoods type to check</param>
		public bool IsInterestedIn( TradeGoods goodType, out TradeGoodInterest currentInterest )
		{
			currentInterest = TradeGoodInterest.None;

			if( (interestingGoods & goodType) != 0 )
			{
				currentInterest = interestLevelTable[goodType];
				return true;
			}

			return false;
		}