/// <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); }
/// <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; }
/// <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; }
/// <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; }