コード例 #1
0
 public Cards.Cost ComputeCost(ICard card)
 {
     if (CostCompute != null)
     {
         CostComputeEventArgs ccea = null;
         lock (CostCompute)
         {
             ccea = new CostComputeEventArgs(card, card.BaseCost);
             // Somehow, this sometimes gets shut off between the initial null check and now.
             // So we need to double-check to make sure that firing off the event is valid
             if (CostCompute != null)
             {
                 CostCompute(this, ccea);
             }
         }
         return(ccea.Cost);
     }
     else
     {
         return(card.BaseCost);
     }
 }
コード例 #2
0
ファイル: Game.cs プロジェクト: micahpaul/dominion_net_multi
		public Cards.Cost ComputeCost(ICard card)
		{
			if (CostCompute != null)
			{
				CostComputeEventArgs ccea = null;
				lock (CostCompute)
				{
					ccea = new CostComputeEventArgs(card, card.BaseCost);
					// Somehow, this sometimes gets shut off between the initial null check and now.
					// So we need to double-check to make sure that firing off the event is valid
					if (CostCompute != null)
						CostCompute(this, ccea);
				}
				return ccea.Cost;
			}
			else
				return card.BaseCost;
		}