예제 #1
0
파일: Card.cs 프로젝트: Aladewale/games
 public static bool CanFallOn(this Card what, Card on)
 {
     bool wRed = what.Suit == Suit.Diamonds || what.Suit == Suit.Hearts;
     bool oRed = on.Suit == Suit.Diamonds || on.Suit == Suit.Hearts;
     if (oRed == wRed)
         return false;
     return Convert.ToInt32(on.Face) - Convert.ToInt32(what.Face) == 1;
 }
예제 #2
0
파일: CardView.cs 프로젝트: Aladewale/games
        public CardView(Card card, int column, int row)
        {
            InitializeComponent();

            Card = card;

            var file = card.GetFileName().Replace(".png", string.Empty).Replace("-", "_");
            BackgroundImage = Resources.ResourceManager.GetObject(file) as Bitmap;
            this.BackgroundImageLayout = ImageLayout.Stretch;

            SetLocation(column, row);
        }