public void ProvideGame(SetGame set) { Contract.Requires <ArgumentNullException>(set != null); VerifyAccess(); if (m_set != null) { throw new InvalidOperationException("Can only set the game once."); } m_set = set; m_set.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) { resetMaterials(); }; resetMaterials(); }
public Set(params SetCard[] cards) : base(cards.OrderBy(card => card.Index).ToArray()) { Contract.Requires(cards.Length == 3); Contract.Requires(SetGame.IsSet(cards[0], cards[1], cards[2])); }