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