/// <summary> /// Add card c to tableu /// </summary> /// <param name="x"></param> public void addCardToTableu(Card c) { Boolean inTableu = false; for (int i = 0; i < getTableuSize(); i++) { if (tableuList.ElementAt(i).Equals(c)) { inTableu = true; break; } } if (inTableu) { c.setVector(new Vector2((int)tableuVector.X, (int)tableuVector.Y + ((getTableuSize() - 1) * 20))); } else { c.setVector(new Vector2((int)tableuVector.X, (int)tableuVector.Y + (getTableuSize() * 20))); } c.setTableu(tableuName); tableuList.Add(c); }
private void DragCard() { // Pick the card up and move to mouse location when left clicked if true if (dragging) { if ((x > 0) && (y > 0) && (x + cardWidth / 2 < screenWidth) && (y + cardHeight / 2 < screenHeight + cardHeight / 2)) { Vector2 v = new Vector2(x - cardWidth / 2, y - cardHeight / 2); temp.setVector(v); } } }
/// <summary> /// Add card c to tableu /// </summary> /// <param name="x"></param> public void addCardToTableu(Card c) { Boolean inTableu = false; for (int i = 0; i < getTableuSize(); i++) { if (tableuList.ElementAt(i).Equals(c)) { inTableu = true; break; } } if (inTableu) { c.setVector(new Vector2((int)tableuVector.X, (int)tableuVector.Y + ((getTableuSize()-1) * 20))); } else c.setVector(new Vector2((int)tableuVector.X, (int)tableuVector.Y + (getTableuSize() * 20))); c.setTableu(tableuName); tableuList.Add(c); }
/// <summary> /// Add card c to foundation /// </summary> /// <param name="x"></param> public void addCardToFoundation(Card c) { c.setVector(new Vector2((int)foundationVector.X, (int)foundationVector.Y)); foundationList.Add(c); }