예제 #1
0
        private void removeCardFromDeck(Models.Card card)
        {
            Models.DeckItemGUIModel deckItemGUIModel;

            deckItemGUIModel = null;

            foreach (Models.DeckItemGUIModel dguim in listDeckContentGUI)
            {
                if (dguim.Card.ID == card.ID)
                {
                    deckItemGUIModel = dguim;
                    break;
                }
            }

            if (deck.removeCard(card))
            {
                deckItemGUIModel.decreaseCount();
            }
            else
            {
                listDeckContentGUI.Remove(deckItemGUIModel);
                stackDeckContents.Children.Remove(deckItemGUIModel.Border);
            }
        }
예제 #2
0
 public CardPaymentDetails(string status                      = null,
                           Models.Card card                   = null,
                           string entryMethod                 = null,
                           string cvvStatus                   = null,
                           string avsStatus                   = null,
                           string authResultCode              = null,
                           string applicationIdentifier       = null,
                           string applicationName             = null,
                           string applicationCryptogram       = null,
                           string verificationMethod          = null,
                           string verificationResults         = null,
                           string statementDescription        = null,
                           Models.DeviceDetails deviceDetails = null,
                           bool?refundRequiresCardPresence    = null,
                           IList <Models.Error> errors        = null)
 {
     Status                     = status;
     Card                       = card;
     EntryMethod                = entryMethod;
     CvvStatus                  = cvvStatus;
     AvsStatus                  = avsStatus;
     AuthResultCode             = authResultCode;
     ApplicationIdentifier      = applicationIdentifier;
     ApplicationName            = applicationName;
     ApplicationCryptogram      = applicationCryptogram;
     VerificationMethod         = verificationMethod;
     VerificationResults        = verificationResults;
     StatementDescription       = statementDescription;
     DeviceDetails              = deviceDetails;
     RefundRequiresCardPresence = refundRequiresCardPresence;
     Errors                     = errors;
 }
예제 #3
0
        public async Task <Models.Card> CreateCardAsync(CreateCardModel createCardReq)
        {
            var request = _mapper.Map <PlayerRequest>(createCardReq);
            var player  = await _bus.RequestAsync <PlayerRequest, PlayerResponse>(request);

            var random   = new Random();
            int index    = random.Next(player.Positions.Length);
            var position = createCardReq.Position != null?player.Positions.First(x => x == createCardReq.Position) : player.Positions[index];

            var card = new Models.Card()
            {
                Id        = Guid.NewGuid(),
                PlayerId  = player.Id,
                UserId    = createCardReq.UserId,
                Name      = player.Name,
                ShortName = player.ShortName,
                Position  = position,
                Rating    = player.Rating,
                Rarity    = CardRarity(player.Rating),
                Form      = player.Form,
                Opened    = true,
                Fitness   = 100,
                CreatedOn = DateTime.Now
            };
            await _cardRepository.AddAsync(card);

            return(card);
        }
예제 #4
0
        private bool checkIfActuallyHeld(Models.Card card)
        {
            int index = -1;

            for (int i = 0; i < HeldCards.Count; i++)
            {
                if (card.Equals(HeldCards[i]))
                {
                    index = i;
                    break;
                }
            }

            if (index != -1)
            {
                HeldCards.RemoveAt(index);
                return(true);
            }
            else
            {
                return(false);

                Console.WriteLine("PLAYER IS ATTEMPTING TO BUY AN UNKNOWN HELD CARD, ILLEGAL MOVE");
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="CreateCardResponse"/> class.
 /// </summary>
 /// <param name="errors">errors.</param>
 /// <param name="card">card.</param>
 public CreateCardResponse(
     IList <Models.Error> errors = null,
     Models.Card card            = null)
 {
     this.Errors = errors;
     this.Card   = card;
 }
예제 #6
0
        // Generates AddViewModel => Card, Car, Employee
        private async Task <AxaptaViewModels.AddViewModel> GenerateAddViewModel(Models.Axapta model)
        {
            if (model != null)
            {
                string _make  = "";
                string _model = "";
                SeparateMakeModel(model.MakeModel, ref _make, ref _model);

                Models.Car car = new Models.Car
                {
                    Model       = _model,
                    Make        = _make,
                    NumberPlate = model.NumberPlate
                };
                string[] fullname = model.EmpName.Trim(' ').Split(' ');
                string   fname = "", sname = "";
                for (int i = fullname.Length - 1; i >= 0; i--)
                {
                    if (i == fullname.Length - 1)
                    {
                        sname = fullname[i];
                    }
                    else
                    {
                        fname += fullname[i];
                    }
                }
                //No duplicates
                var emp = await _kuras_context.Employee.FirstOrDefaultAsync(x => x.EmplId == model.EmpIdEmplTable);

                if (emp == null)
                {
                    emp = new Models.Employee
                    {
                        Fname  = fname,
                        Lname  = sname,
                        City   = model.CityCode,
                        Group  = model.EmpGroup,
                        EmplId = model.EmpIdEmplTable
                    };
                }

                Models.Card card = new Models.Card
                {
                    Number  = model.CardNumber,
                    NumberD = model.CardNumberD,
                    Limit   = 999
                };

                AxaptaViewModels.AddViewModel addViewModel = new AxaptaViewModels.AddViewModel
                {
                    Card     = card,
                    Employee = emp,
                    Car      = car
                };
                return(addViewModel);
            }
            return(null);
        }
예제 #7
0
 public TenderCardDetails(string status      = null,
                          Models.Card card   = null,
                          string entryMethod = null)
 {
     Status      = status;
     Card        = card;
     EntryMethod = entryMethod;
 }
예제 #8
0
        private void loadCardInfo(Models.Card Card)
        {
            rchCardInfo.Document.Blocks.Clear();

            TextRange tr = new TextRange(rchCardInfo.Document.ContentEnd, rchCardInfo.Document.ContentEnd);

            tr.Text += "Name: ";
            tr.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Bold);
            tr       = new TextRange(rchCardInfo.Document.ContentEnd, rchCardInfo.Document.ContentEnd);
            tr.Text += Card.Name;
            tr.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Normal);
            tr      = new TextRange(rchCardInfo.Document.ContentEnd, rchCardInfo.Document.ContentEnd);
            tr.Text = "\nType: ";
            tr.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Bold);
            tr      = new TextRange(rchCardInfo.Document.ContentEnd, rchCardInfo.Document.ContentEnd);
            tr.Text = Card.Type;
            tr.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Normal);
            tr      = new TextRange(rchCardInfo.Document.ContentEnd, rchCardInfo.Document.ContentEnd);
            tr.Text = "\nElement: ";
            tr.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Bold);
            tr      = new TextRange(rchCardInfo.Document.ContentEnd, rchCardInfo.Document.ContentEnd);
            tr.Text = Card.Element;
            tr.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Normal);
            tr      = new TextRange(rchCardInfo.Document.ContentEnd, rchCardInfo.Document.ContentEnd);
            tr.Text = "\nCost: ";
            tr.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Bold);
            tr      = new TextRange(rchCardInfo.Document.ContentEnd, rchCardInfo.Document.ContentEnd);
            tr.Text = Card.Cost.ToString();
            tr.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Normal);
            if (Card.Race != null)
            {
                tr      = new TextRange(rchCardInfo.Document.ContentEnd, rchCardInfo.Document.ContentEnd);
                tr.Text = "\nRace: ";
                tr.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Bold);
                tr      = new TextRange(rchCardInfo.Document.ContentEnd, rchCardInfo.Document.ContentEnd);
                tr.Text = Card.Race;
                tr.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Normal);
            }
            if (Card.Power != -1)
            {
                tr      = new TextRange(rchCardInfo.Document.ContentEnd, rchCardInfo.Document.ContentEnd);
                tr.Text = "\nPower: ";
                tr.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Bold);
                tr      = new TextRange(rchCardInfo.Document.ContentEnd, rchCardInfo.Document.ContentEnd);
                tr.Text = Card.Power.ToString();
                tr.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Normal);
            }
            tr      = new TextRange(rchCardInfo.Document.ContentEnd, rchCardInfo.Document.ContentEnd);
            tr.Text = "\nText: ";
            tr.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Bold);
            if (Card.Text != null)
            {
                tr      = new TextRange(rchCardInfo.Document.ContentEnd, rchCardInfo.Document.ContentEnd);
                tr.Text = Card.Text;
                tr.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Normal);
            }
            rchCardInfo.ScrollToHome();
        }
예제 #9
0
        // click on card in deck

        public void deckItem_Clicked(Models.Card card)
        {
            loadCardInfo(card);

            if (editModeON)
            {
                removeCardFromDeck(card);
            }
        }
예제 #10
0
 public Builder(
     string idempotencyKey,
     string sourceId,
     Models.Card card)
 {
     this.idempotencyKey = idempotencyKey;
     this.sourceId       = sourceId;
     this.card           = card;
 }
예제 #11
0
        public static List <Tuple <Models.Card, string> > GetAssociatedCards(Models.Card card)
        {
            var matches = new[] { "includes", "references", "active_ability", "passive_ability" };

            return(card.references.Where(x =>
                                         matches.Contains(x.ref_type)
                                         ).Select(x =>
                                                  new Tuple <Models.Card, string>(Controllers.Card.Helpers.FindById.Perform(x.card_id), x.ref_type)
                                                  ).ToList());
        }
예제 #12
0
 public ActionResult CardForm(Models.Card card)
 {
     if (ModelState.IsValid)
     {
         return(View("CardSent", card));
     }
     else
     {
         return(View());
     }
 }
 public IActionResult BirthdayForm(Models.Card card)
 {
     if (ModelState.IsValid)
     {
         return(View("Thanks", card));
     }
     else
     {
         return(View());
     }
 }
예제 #14
0
        static Models.Card RandomCard()
        {
            Models.Rank cardRank = RandomRank();
            Models.Suit cardSuit = RandomSuit();

            Models.Card card = new Models.Card();
            card.CardRank = cardRank;
            card.CardSuit = cardSuit;

            return(card);
        }
        public void Card_Valid_False()
        {
            FoodWebAPI.Models.Card card = new Models.Card();

            card.CardNumber = 1111111111111;
            card.CVC        = 11;
            card.Month      = -1;
            card.Year       = 111;

            Assert.IsTrue(!card.IsCardValid().IsASuccess);
        }
예제 #16
0
        private static List <Models.Card> ConvertFromListOfServiceCardsToListOfClientCards(GameTableServiceReference.Card[] serviceCards)
        {
            List <Models.Card> clientCards = new List <Models.Card>();

            for (int i = 0; i < serviceCards.Length; i++)
            {
                Models.Card clientCard = ConvertFromServiceCardToClientCard(serviceCards[i]);
                clientCards.Add(clientCard);
            }
            return(clientCards);
        }
예제 #17
0
 public IActionResult BirthdayCardForm(Models.Card cardResponse)
 {
     if (ModelState.IsValid)
     {
         return(View("Sent", cardResponse));
     }
     else
     {
         return(View("Index", cardResponse));
     }
 }
예제 #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CreateCardRequest"/> class.
 /// </summary>
 /// <param name="idempotencyKey">idempotency_key.</param>
 /// <param name="sourceId">source_id.</param>
 /// <param name="card">card.</param>
 /// <param name="verificationToken">verification_token.</param>
 public CreateCardRequest(
     string idempotencyKey,
     string sourceId,
     Models.Card card,
     string verificationToken = null)
 {
     this.IdempotencyKey    = idempotencyKey;
     this.SourceId          = sourceId;
     this.VerificationToken = verificationToken;
     this.Card = card;
 }
예제 #19
0
 public Data.Card ReverseConvert(Models.Card value)
 {
     return(new Data.Card()
     {
         ID = value.ID,
         Name = value.Name,
         Comment = value.Comment,
         Date = value.Date,
         Fields = DataUtils.ValueOrDefault(value.Fields).ConvertAll(input => fieldConverter.Value.ReverseConvert(input)),
         Tags = DataUtils.ValueOrDefault(value.Tags).ConvertAll((input) => tagConverter.Value.ReverseConvert(input))
     });
 }
 private static GameServiceReference.Card ConvertFromClientCardToServiceCard(Models.Card clientCard)
 {
     GameServiceReference.Card serviceCard = new GameServiceReference.Card()
     {
         Id          = clientCard.Id,
         cardtype    = (GameServiceReference.Card.CardType)clientCard.cardtype,
         Name        = clientCard.Name,
         Description = clientCard.Description,
         Value       = clientCard.Value
     };
     return(serviceCard);
 }
예제 #21
0
 public SpellAndTrapCard(Models.Card card_m)
 {
     Icon             = card_m.Icon;
     CardCategory     = card_m.Category;
     CardText         = card_m.Ctext;
     Name             = card_m.Name;
     Cname            = card_m.Cname;
     Password         = card_m.Password;
     ChooseTargetType = card_m.ChooseTargetType;
     UID    = Guid.NewGuid().ToString();
     Status = new CardStatus();
 }
예제 #22
0
        public ActionResult Delete([FromBody] Models.Request.CardsEditRequest model)
        {
            using (Models.CreditCardsDBContext db = new Models.CreditCardsDBContext())
            {
                Models.Card oCards = db.Cards.Find(model.Id);

                db.Remove(oCards);
                db.SaveChanges();
            }

            return(Ok());
        }
예제 #23
0
 private static Models.Card ConvertFromServiceCardToClientCard(GameTableServiceReference.Card serviceCard)
 {
     Models.Card clientCard = new Models.Card()
     {
         Id          = serviceCard.Id,
         cardtype    = (Models.Card.CardType)serviceCard.cardtype,
         Name        = serviceCard.Name,
         Description = serviceCard.Description,
         Value       = serviceCard.Value
     };
     return(clientCard);
 }
예제 #24
0
 public IActionResult AddCard([FromBody] Models.Card value)
 {
     DBContext.Card.Add(value);
     try
     {
         DBContext.SaveChanges();
     }
     catch (Exception ex)
     {
         return(BadRequest());
     }
     return(Ok());
 }
예제 #25
0
        private static string GenerateLink(Models.Card card, LinkTypes linkType)
        {
            var str = new Regex("[^a-zA-Z0-9 -]").Replace(card.card_name.english, "");

            switch (linkType)
            {
            case LinkTypes.artifactFire:
                return($"https://www.artifactfire.com/artifact/cards/{str.Replace(' ', '-')}");

            case LinkTypes.drawTwo:
                return($"https://drawtwo.gg/cards/view/{str.Replace(" ", "")}");
            }
            return("https://playartifact.com/");
        }
예제 #26
0
        public void Shuffle()
        {
            Random rand = new Random();
            int    n    = shoe.Count;

            while (n > 1)
            {
                n--;
                int         k    = rand.Next(n + 1);
                Models.Card temp = shoe[k];
                shoe[k] = shoe[n];
                shoe[n] = temp;
            }
        }
예제 #27
0
        public SimpleCardGUIModel(Models.Card card, int width = 75, int height = 104)
        {
            logger = new Log.Logger();

            // Border
            Border        = new Border();
            Border.Width  = width;
            Border.Height = height;

            Border.VerticalAlignment   = VerticalAlignment.Top;
            Border.HorizontalAlignment = HorizontalAlignment.Left;
            Border.Margin          = new Thickness(0);
            Border.BorderThickness = new Thickness(5);
            Border.BorderBrush     = Brushes.Transparent;

            // Image
            Image = new Image();
            try
            {
                if (card == null)
                {
                    Image.Source = new System.Windows.Media.Imaging.BitmapImage(
                        new Uri(
                            string.Format("{0}{1}",
                                          AppDomain.CurrentDomain.BaseDirectory,
                                          cardBackPath),
                            UriKind.Absolute));
                }
                else
                {
                    Image.Source = new System.Windows.Media.Imaging.BitmapImage(
                        new Uri(
                            string.Format("{0}{1}{2}/{3}.jpg",
                                          AppDomain.CurrentDomain.BaseDirectory,
                                          cardsPath,
                                          card.Set,
                                          card.Name),
                            UriKind.Absolute));
                }
            }
            catch (Exception ex)
            {
                logger.Log(ex.ToString());
            }

            Image.Stretch = Stretch.UniformToFill;

            Border.Child = Image;
        }
예제 #28
0
        //remove card from wishlist
        public ActionResult removeWishlist(int id)
        {
            checkCookie();
            checkUserID();

            Models.Card card = db.Cards.Where(x => x.ID == id).FirstOrDefault();

            id = Convert.ToInt32(Session["UserID"].ToString());
            User user = db.Users.Include("Wishlist").Where(x => x.ID == id).FirstOrDefault();

            user.Wishlist.Remove(card);
            db.SaveChanges();

            return(RedirectToAction("Wishlist", new { id = id }));
        }
예제 #29
0
        public ActionResult Post([FromBody] Models.Request.CardsRequest model)
        {
            using (Models.CreditCardsDBContext db = new Models.CreditCardsDBContext())
            {
                Models.Card oCards = new Models.Card();
                oCards.Titular         = model.Titular;
                oCards.NumeroTarjeta   = model.NumeroTarjeta;
                oCards.FechaExpiracion = model.FechaExpiracion;
                oCards.Cvv             = model.CVV;

                db.Cards.Add(oCards);
                db.SaveChanges();
            }

            return(Ok());
        }
예제 #30
0
        public ActionResult Put([FromBody] Models.Request.CardsEditRequest model)
        {
            using (Models.CreditCardsDBContext db = new Models.CreditCardsDBContext())
            {
                Models.Card oCards = db.Cards.Find(model.Id);
                oCards.Titular         = model.Titular;
                oCards.NumeroTarjeta   = model.NumeroTarjeta;
                oCards.FechaExpiracion = model.FechaExpiracion;
                oCards.Cvv             = model.CVV;

                db.Entry(oCards).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
                db.SaveChanges();
            }

            return(Ok());
        }