예제 #1
0
 public miniEnch(SimCard id, int crtr, int controler, int copydr)
 {
     this.CARDID              = id;
     this.creator             = crtr;
     this.controllerOfCreator = controler;
     this.copyDeathrattle     = copydr;
 }
예제 #2
0
        private string getMullRuleKey(SimCard cardIDM = null, CardClass ownMHero = CardClass.INVALID, CardClass enemyMHero = CardClass.INVALID, int isExtraRule = 0)
        {
            var MullRuleKey = new StringBuilder("", 500);

            MullRuleKey.Append(cardIDM ?? SimCard.None).Append(";").Append(ownMHero).Append(";").Append(enemyMHero).Append(";").Append(isExtraRule);
            return(MullRuleKey.ToString());
        }
예제 #3
0
        public Deck(Playfield p, SimCard cardId, int number, bool own)
        {
            var newDeck = new Deck();

            newDeck.deckChanged = true;
            if (this.deckChanged)
            {
                newDeck.deckSize += this.deckSize;
                foreach (var diff in this.deckDiff)
                {
                    newDeck.deckDiff.Add(diff.Key, diff.Value);
                }
            }

            if (number > 0)
            {
                newDeck.deckSize += number;
                if (newDeck.deckDiff.ContainsKey(cardId))
                {
                    newDeck.deckDiff[cardId] += number;
                }
                else
                {
                    newDeck.deckDiff.Add(cardId, number);
                }
            }

            //if (own) p.ownDeck = newDeck;
            //else p.enemyDeck = newDeck;
        }
예제 #4
0
        public IActionResult Import()
        {
            IFormFile     file        = Request.Form.Files[0];
            string        folderName  = "UploadExcel";
            string        webRootPath = _hostingEnvironment.WebRootPath;
            string        newPath     = Path.Combine(webRootPath, folderName);
            StringBuilder sb          = new StringBuilder();

            if (!Directory.Exists(newPath))
            {
                Directory.CreateDirectory(newPath);
            }
            if (file.Length > 0)
            {
                string sFileExtension = Path.GetExtension(file.FileName).ToLower();
                ISheet sheet;
                string fullPath = Path.Combine(newPath, file.FileName);
                using (var stream = new FileStream(fullPath, FileMode.Create))
                {
                    file.CopyTo(stream);
                    stream.Position = 0;
                    if (sFileExtension == ".xls")
                    {
                        HSSFWorkbook hssfwb = new HSSFWorkbook(stream);       //This will read the Excel 97-2000 formats
                        sheet = hssfwb.GetSheetAt(0);                         //get first sheet from workbook
                    }
                    else
                    {
                        XSSFWorkbook hssfwb = new XSSFWorkbook(stream);   //This will read 2007 Excel format
                        sheet = hssfwb.GetSheetAt(0);                     //get first sheet from workbook
                    }
                    IRow headerRow = sheet.GetRow(0);                     //Get Header Row
                    int  cellCount = headerRow.LastCellNum;

                    for (int i = (sheet.FirstRowNum + 1); i <= sheet.LastRowNum; i++)                     //Read Excel File
                    {
                        IRow row = sheet.GetRow(i);
                        if (row == null)
                        {
                            continue;
                        }
                        if (row.Cells.All(d => d.CellType == CellType.Blank))
                        {
                            continue;
                        }


                        if (!db.SimCard.Any(s => s.SimCardNumber.Equals(row.GetCell(1).ToString())))
                        {
                            SimCard sim = new SimCard();
                            sim.SimCardNumber = row.GetCell(1).ToString();
                            sim.ACCT_CODE     = row.GetCell(2).ToString();
                            db.SimCard.Add(sim);
                            db.SaveChanges();
                        }
                    }
                }
            }
            return(View());
        }
예제 #5
0
        private void client_GetSimInfoFinished(object sender, GetInfoCompletedArgs args)
        {
            switch (args.Canceled)
            {
            case true:
                Tools.Tools.SetProgressIndicator(false);
                break;

            case false:
                if (string.IsNullOrEmpty(args.Json))
                {
                    return;
                }
                if (!string.Equals(args.Json, "[]"))
                {
                    try
                    {
                        Card = JsonConvert.DeserializeObject <SimCard>(args.Json);
                    }
                    catch (Exception)
                    {
                        Tools.Tools.SetProgressIndicator(false);
                        return;
                    }
                }
                break;
            }
            OnGetSimInfoFinished(args);
        }
예제 #6
0
        public DataTable VerifySimCard(SimCard sim)
        {
            DataTable User = new DataTable();

            try
            {
                string query = "Select NumSim FROM SimCard where NumSim=@NumSim;";

                SqlCommand comando = new SqlCommand(query, conexion.CrearConexion())
                {
                    CommandType = CommandType.Text
                };

                SqlDataAdapter adaptador = new SqlDataAdapter()
                {
                    SelectCommand = comando
                };

                comando.Parameters.AddWithValue("@NumSim", sim.NumSim);

                adaptador.Fill(User);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                conexion.CerrarConexion();
            }

            return(User);
        }
예제 #7
0
        public IHttpActionResult Patch([FromODataUri] int key, Delta <SimCard> patch)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            SimCard simcard = db.SimCards.Find(key);

            if (simcard == null)
            {
                return(NotFound());
            }

            patch.Patch(simcard);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SimCardExists(key))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Updated(simcard));
        }
예제 #8
0
        //At the start of your turn, swap this minion with a random one in your hand.

        public override void onTurnStartTrigger(Playfield p, Minion triggerEffectMinion, bool turnStartOfOwner)
        {
            if (turnStartOfOwner && triggerEffectMinion.own == turnStartOfOwner)
            {
                var temp2 = new List <Handcard>();
                foreach (var hc in p.owncards)
                {
                    if (hc.card.Type == CardType.MINION)
                    {
                        temp2.Add(hc);
                    }
                }

                temp2.Sort((a, b) => - a.card.Attack.CompareTo(b.card.Attack)); //damage the stronges
                foreach (var mins in temp2)
                {
                    SimCard c = mins.card.CardId;
                    p.minionTransform(triggerEffectMinion, c);
                    triggerEffectMinion.playedThisTurn = false;
                    triggerEffectMinion.Ready          = true;
                    p.removeCard(mins);
                    p.drawACard(CardIds.Collectible.Neutral.AlarmOBot, true, true);
                    break;
                }

                return;
            }

            if (!turnStartOfOwner && triggerEffectMinion.own == turnStartOfOwner)
            {
                p.minionGetBuffed(triggerEffectMinion, 4, 4);
                triggerEffectMinion.Hp = triggerEffectMinion.maxHp;
            }
        }
예제 #9
0
        /// <summary>
        ///     Will only return details of a SINGLE simcard.
        /// </summary>
        /// <remarks>TODO: Add support for multiple sim cards. See issue #1</remarks>
        public IReadOnlyList <SimCard> GetSimCards()
        {
            var results = new List <SimCard>();

            var modem = MobileBroadbandModem.GetDefault();

            if (modem == null)
            {
                return(results.AsReadOnly());
            }

            var account = modem.CurrentAccount;

            if (account == null)
            {
                return(results.AsReadOnly());
            }

            var simCard = new SimCard();

            simCard.ICCID  = account.CurrentDeviceInformation.SimIccId;
            simCard.IMSI   = account.CurrentDeviceInformation.SubscriberId;
            simCard.MSISDN = modem.DeviceInformation.TelephoneNumbers;

            simCard.MCC  = ExtractMCC(simCard.IMSI);
            simCard.MNC  = ExtractMNC(simCard.IMSI);
            simCard.MSID = ExtractMSID(simCard.IMSI);

            results.Add(simCard);

            return(results.AsReadOnly());
        }
예제 #10
0
 public void Reset()
 {
     this.Id            = SimCard.None;
     this.questProgress = 0;
     this.maxProgress   = 1000;
     this.mobsTurn.Clear();
 }
예제 #11
0
        // PUT odata/SimCard(5)
        public IHttpActionResult Put([FromODataUri] int key, SimCard simcard)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (key != simcard.Id)
            {
                return(BadRequest());
            }

            db.Entry(simcard).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SimCardExists(key))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Updated(simcard));
        }
예제 #12
0
        public async Task <SimCard> InsertAsync(SimCard entity)
        {
            await _context.SimCards.AddAsync(entity);

            await _context.SaveChangesAsync();

            return(await Task.FromResult(entity));
        }
예제 #13
0
 public Handcard(SimCard c)
 {
     this.position  = 0;
     this.entity    = -1;
     this.card      = c;
     this.addattack = 0;
     this.addHp     = 0;
 }
예제 #14
0
            public QuestItem(string s)
            {
                var q = s.Split(' ');

                this.Id            = q[0];
                this.questProgress = Convert.ToInt32(q[1]);
                this.maxProgress   = Convert.ToInt32(q[2]);
            }
예제 #15
0
 public void setHCtoHC(Handcard hc)
 {
     this.manacost      = hc.manacost;
     this.addattack     = hc.addattack;
     this.addHp         = hc.addHp;
     this.card          = hc.card;
     this.elemPoweredUp = hc.elemPoweredUp;
 }
예제 #16
0
            public bool isCardInCombo(SimCard card)
            {
                if (this.combocards.ContainsKey(card.CardId))
                {
                    return(true);
                }

                return(false);
            }
예제 #17
0
            public bool isMultiTurn1Card(SimCard card)
            {
                if (this.combocardsTurn1.ContainsKey(card.CardId))
                {
                    return(true);
                }

                return(false);
            }
예제 #18
0
        public int getPlayedCardFromHand(SimCard name)
        {
            if (this.mobsGame.ContainsKey(name))
            {
                return(this.mobsGame[name]);
            }

            return(0);
        }
예제 #19
0
        SimCard copymin = CardIds.Collectible.Neutral.ChillwindYeti; // we take a icewindjety :D

        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            if (p.enemyDeckSize < 1)
            {
                this.copymin = CardIds.NonCollectible.Priest.Mindgames_ShadowOfNothingToken; // Shadow of Nothing
            }

            p.callKid(this.copymin, p.ownMinions.Count, ownplay, false);
        }
예제 #20
0
 public Handcard(Handcard hc)
 {
     this.position      = hc.position;
     this.entity        = hc.entity;
     this.manacost      = hc.manacost;
     this.card          = hc.card;
     this.addattack     = hc.addattack;
     this.addHp         = hc.addHp;
     this.elemPoweredUp = hc.elemPoweredUp;
 }
예제 #21
0
 public void Reset()
 {
     this.sb.Clear();
     this.mobsGame.Clear();
     this.ownQuest    = new QuestItem();
     this.enemyQuest  = new QuestItem();
     this.nextMobName = SimCard.None;
     this.nextMobId   = 0;
     this.prevMobId   = 0;
 }
예제 #22
0
        public SimCard RemoveSimCard(int simCardIx)
        {
            SimCard sim = SimCards[simCardIx];

            SimCards[simCardIx] = null;
            sim.CallReceiver    = null;
            sim.SmsReceiver     = null;

            return(sim);
        }
예제 #23
0
        public async Task <SimCard> UpdateAsync(SimCard model)
        {
            var exist = await _repository.GetAsync(model.Id, model.MobileNumber);

            if (exist == null)
            {
                return(await _repository.UpdateAsync(model.Id, model.MobileNumber, model.SimNumber, model.OperatorId, model.OperatorPackageId, model.UserId, model.UserName));
            }
            return(null);
        }
예제 #24
0
 public void updatePlayedCardFromHand(Handcard hc)
 {
     this.nextMobName = SimCard.None;
     this.nextMobId   = 0;
     if (hc != null && hc.card.Type == CardType.MINION)
     {
         this.nextMobName = hc.card.CardId;
         this.nextMobId   = hc.entity;
     }
 }
예제 #25
0
        public SimCard DeleteCard(string comPort)
        {
            SimCard simCard = db.Cards.Find(comPort);

            if (simCard != null)
            {
                db.Cards.Remove(simCard);
                db.SaveChanges();
            }
            return(simCard);
        }
예제 #26
0
 private void CheckSimCard(SimCard simCardToInstall)
 {
     if (_simCards.Count == _availableSimCardSlots)
     {
         throw new CantInstallSimCardException($"Cant install simcard, cause {_simCards.Count}/{_availableSimCardSlots} available lost are busy.");
     }
     if (_simCards.Exists(simCard => simCard.Slot == simCardToInstall.Slot))
     {
         throw new CantInstallSimCardException($"Cant install simcard into slot {simCardToInstall.Slot}, cause its already busy.");
     }
 }
예제 #27
0
        // Your Hero Power becomes 'Deal 2 damage'. If already in Shadowform: 3 damage.

        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            SimCard newHeroPower = CardIds.NonCollectible.Priest.Shadowform_MindSpikeToken; // Mind Spike

            if ((ownplay ? p.ownHeroAblility.card.CardId : p.enemyHeroAblility.card.CardId) == CardIds.NonCollectible.Priest.Shadowform_MindSpikeToken)
            {
                newHeroPower = CardIds.NonCollectible.Priest.Shadowform_MindShatterToken; // Mind Shatter
            }

            p.setNewHeroPower(newHeroPower, ownplay);
        }
예제 #28
0
        public void updateHero(Weapon w, CardClass heron, SimCard ability, bool abrdy, int abCost, Minion hero, int enMaxMana = 10)
        {
            if (w.name == CardIds.Collectible.Warrior.FoolsBane)
            {
                w.cantAttackHeroes = true;
            }

            if (hero.own)
            {
                this.ownWeapon = new Weapon(w);

                this.ownHero           = new Minion(hero);
                this.ownHero.CardClass = heron;
                if (this.ownHeroStartClass == CardClass.INVALID)
                {
                    this.ownHeroStartClass = hero.CardClass;
                }

                this.ownHero.poisonous = this.ownWeapon.poisonous;
                this.ownHero.lifesteal = this.ownWeapon.lifesteal;
                if (this.ownWeapon.name == CardIds.Collectible.Hunter.GladiatorsLongbow)
                {
                    this.ownHero.immuneWhileAttacking = true;
                }

                this.heroAbility       = ability;
                this.ownHeroPowerCost  = abCost;
                this.ownAbilityisReady = abrdy;
            }
            else
            {
                this.enemyWeapon = new Weapon(w);
                this.enemyHero   = new Minion(hero);
                ;

                this.enemyHero.CardClass = heron;
                if (this.enemyHeroStartClass == CardClass.INVALID)
                {
                    this.enemyHeroStartClass = this.enemyHero.CardClass;
                }

                this.enemyHero.poisonous = this.enemyWeapon.poisonous;
                this.enemyHero.lifesteal = this.enemyWeapon.lifesteal;
                if (this.enemyWeapon.name == CardIds.Collectible.Hunter.GladiatorsLongbow)
                {
                    this.enemyHero.immuneWhileAttacking = true;
                }

                this.enemyAbility       = ability;
                this.enemyHeroPowerCost = abCost;

                this.enemyMaxMana = enMaxMana;
            }
        }
예제 #29
0
 public async Task <IActionResult> Put(SimCard model)
 {
     return(await ExecuteRequest(async() =>
     {
         var response = await _service.UpdateAsync(model);
         if (response == null)
         {
             return StatusCode(StatusCodes.Status409Conflict, "Sim Card already exists.");
         }
         return Ok(response);
     }));
 }
예제 #30
0
        // POST odata/SimCard
        public IHttpActionResult Post(SimCard simcard)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.SimCards.Add(simcard);
            db.SaveChanges();

            return(Created(simcard));
        }
예제 #31
0
		public void TrocarBandeja(SimCard simCard)
		{
			int ret = ACBrSMSInterop.SMS_TrocarBandeja(this.Handle, (int)simCard);
			CheckResult(ret);
		}