Exemplo n.º 1
0
        public Set(params SetCard[] cards)
            : base(cards.OrderBy(card => card.Index).ToArray())
        {
            Util.RequireArgument(
                cards.Length == 3,
                "cards",
                "A set must be three cards.");

            Util.RequireArgument(
                SetGame.IsSet(cards[0], cards[1], cards[2]),
                "cards",
                "The provided cards don't make a set.");
        }
        public void ProvideGame(SetGame set)
        {
            VerifyAccess();
            if (m_set != null)
            {
                throw new InvalidOperationException("Can only set the game once.");
            }

            Util.RequireNotNull(set, "set");
            m_set = set;
            m_set.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e)
            {
                resetMaterials();
            };

            resetMaterials();
        }