public CardPack CreateOpenedClosedPack() { CustomCardPack pack = new CustomCardPack(); pack.displayMode = CardPack.DisplayMode.OnlyLast; pack.canAccept = (cp) => { return(true); }; pack.canGive = (count) => { return(count == 1 && count <= pack.Count); }; pack.OnActivate = () => { if (cardPackTable["closed"].Count == 0) { int c = pack.Count - 1; for (int i = 0; i < c; i++) { ConfirmMove(cardPackTable["openedClosed"], cardPackTable["closed"], 1); } } }; return(pack); }
public CardPack CreateClosedPack() { CustomCardPack pack = new CustomCardPack(); Boolean canGiveFlag = false; pack.displayMode = CardPack.DisplayMode.Hidden; pack.canAccept = (cp) => { return(true); }; pack.canGive = (count) => { return(canGiveFlag); }; pack.OnActivate = () => { if (cardPackTable["closed"].Count == 0) { return; } canGiveFlag = true; ConfirmMove(cardPackTable["closed"], cardPackTable["openedClosed"], 1); canGiveFlag = false; }; return(pack); }
public CardPack CreateGamePack() { CustomCardPack pack = new CustomCardPack(); pack.displayMode = CardPack.DisplayMode.Full; // TODO: написать реализацию pack.canAccept = (cp) => { if (pack.Count == 0) { return(true); } if (Card.CardColor(cp.FirstCard) == Card.CardColor(pack.LastCard) || Card.Dignity(cp.FirstCard) >= Card.Dignity(pack.LastCard)) { return(false); } return(true); }; pack.canGive = (count) => { return(count <= pack.Count); }; return(pack); }
public override CardPack Copy() { var pack = new CustomCardPack(this.cards, this.displayMode); pack.canAccept = this.canAccept; pack.canGive = this.canGive; return(pack); }
public CardPack CreateSecretPack() { CustomCardPack pack = new CustomCardPack(); pack.displayMode = CardPack.DisplayMode.OnlyLast; pack.canAccept = (cp) => { return(true); }; // TODO: написать реализацию pack.canGive = (count) => { return(count == 1 && count <= pack.Count); }; return(pack); }
public CardPack CreateBasePack() { CustomCardPack pack = new CustomCardPack(); pack.displayMode = CardPack.DisplayMode.OnlyLast; pack.canAccept = (cp) => { if (pack.Count == 0) { return(cp.Count == 1 && Card.Dignity(cp.FirstCard) == 0); } return(cp.Count == 1 && Card.Suit(cp.FirstCard) == Card.Suit(pack.LastCard) && Card.Dignity(cp.FirstCard) - Card.Dignity(pack.LastCard) == 1); }; pack.canGive = (count) => { return(false); }; return(pack); }