Exemplo n.º 1
0
 /// <summary>
 /// Clones this instance.
 /// </summary>
 /// <returns></returns>
 public Cell Clone()
 {
     Cell c = new Cell();
     if (this.HasCard)
         c.Card = this.Card.Clone();
     return c;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Checks to see if it is possible to move the specified <see cref="Card"/> to the specified <see cref="Cell"/>.
        /// </summary>
        /// <param name="card">The <see cref="Card"/> to check if its possible to move to the specified <see cref="Cell"/></param>
        /// <param name="cell">The destination <see cref="Cell"/> to hold the specified <see cref="Card"/></param>
        /// <returns><c>true</c> if the specified <see cref="Card"/> can be moved to the specified <see cref="Cell"/>; otherwise <c>false</c></returns>
        public virtual bool CanMoveToCell(Card card, Cell cell)
        {
            if (!EnforceRules)
                return true;

            if (!cell.HasCard)
                return true;
            return false;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GameCell"/> class.
 /// </summary>
 public GameCell(Cell cell)
 {
     InitializeComponent();
 }