void Start() { levelData = ExtensionMethod.GetLevelTb(Player.Ins.playerData.nLevel); if (levelData == null) { Debug.LogError("levelDataNull"); levelData = new LevelData(); } playerInfo.PlayerChangeInfo(Player.Ins.playerData, levelData); expendables.ChangeText(levelData); ShopInit(); inven.Init(); eStage eStage = eStage.Forest1; for (int i = 0; i < logoQuestText.Count; ++i) { var data = ExtensionMethod.GetQuestData((int)eStage); if (data == null) { Debug.LogError("data error"); return; } logoQuestText[i].text = string.Format("{0}", data.strQuest); eStage += (int)eStage.Forest4; } inven.idx = Player.Ins.heroDataList.Count; }
public void LoadByFilters(IFilterControlView filterView, int catId) { SearchFilters filters = new SearchFilters() { IsBuyItNow = filterView.IsBuyItNow, IsBidding = filterView.IsBidding, IsMinPrice = filterView.IsMinPrice, IsMaxPrice = filterView.IsMaxPrice, IsMinOffersNum = filterView.IsMinOffersNum, IsMaxOffersNum = filterView.IsMaxOffersNum, IsMinViewsCount = filterView.IsMinViewsCount, IsMaxViewsCount = filterView.IsMaxViewsCount, IsMaxTimeLeft = filterView.IsMaxTimeLeft, IsShipmentType = filterView.IsShipmentType, Search = filterView.Search, CatId = catId }; filters.ShipmentId = ExtensionMethod.TryIntParse(filterView.ShipmentId); filters.MinPrice = ExtensionMethod.TryIntParse(filterView.MinPrice); filters.MaxPrice = ExtensionMethod.TryIntParse(filterView.MaxPrice); filters.MinOffersNum = ExtensionMethod.TryIntParse(filterView.MinOffersNum); filters.MaxOffersNum = ExtensionMethod.TryIntParse(filterView.MaxOffersNum); filters.MinViewsCount = ExtensionMethod.TryIntParse(filterView.MinViewsCount); filters.MaxViewsCount = ExtensionMethod.TryIntParse(filterView.MaxViewsCount); filters.MaxDaysLeft = ExtensionMethod.TryIntParse(filterView.MaxDaysLeft); auctions = auctionsRepo.SearchWithFilters(filters); }
/// <summary> /// The IsStartTimeThereForSameBmUnitRecord /// </summary> /// <param name="aggregate">The aggregate<see cref="Aggregate{Fpn}"/></param> /// <returns>The <see cref="bool"/></returns> private static bool IsStartTimeThereForSameBmUnitRecord(Aggregate <Fpn> aggregate) { bool startTimeAvailable = false; List <Fpn> inValidFpns; List <Fpn> validFpns; var fpnGroups = aggregate.ValidFlow.GroupBy(g => new { g.BmuName }); int recordCount = 0; int bmuCount = 0; foreach (var fpnGroup in fpnGroups) { recordCount = fpnGroup.Where(g => g.TimeFrom.TimeOfDay.ToString() == ExtensionMethod.SettlementPeriodStartTime(g.SettlementPeriod)).GroupBy(c => c.BmuName).ToList().Count; bmuCount = fpnGroup.GroupBy(c => c.BmuName).ToList().Count; if (recordCount == bmuCount) { startTimeAvailable = true; validFpns = fpnGroup.OrderBy(g => g.TimeFrom).ToList(); AddValidFpns(aggregate, validFpns); } else { startTimeAvailable = false; inValidFpns = fpnGroup.OrderBy(g => g.TimeFrom).ToList(); foreach (var inValidFpn in inValidFpns) { aggregate.ValidFlow.Remove(inValidFpn); } aggregate.InValidFlow.AddRange(inValidFpns); } } return(startTimeAvailable); }
public void LevelUp() { if (GameMrg.Ins.currentGemUpgrade >= gemMaxLevel) { GameSceneUI.Ins.centerUiLabel.text = "Your UpgradeLevel Max"; GameSceneUI.Ins.centerUiLabel.gameObject.SetActive(true); StartCoroutine(GameSceneUI.Ins.GameObjectWaitSetFalse(GameSceneUI.Ins.centerUiLabel.gameObject, 0.5f)); } else { if (GameMrg.Ins.money > ExtensionMethod.GetSpawnTowerTb(GameMrg.Ins.currentGemUpgrade).costGold) { GameMrg.Ins.money -= ExtensionMethod.GetSpawnTowerTb(GameMrg.Ins.currentGemUpgrade).costGold; MoneyUISet(); GameMrg.Ins.currentGemUpgrade++; GameMrg.Ins.ReSetSpawnRadom(); } else { GameSceneUI.Ins.centerUiLabel.gameObject.SetActive(true); GameSceneUI.Ins.centerUiLabel.text = "You have not enough money"; StartCoroutine(GameSceneUI.Ins.GameObjectWaitSetFalse(GameSceneUI.Ins.centerUiLabel.gameObject, 0.5f)); } } }
public ServiceResult KullanıcıEkle(long tckimlik, string adi, string soyadi, string dogumyili, string mailadresi, string sifre1, string sifre2, string kisi) { KPSPublicSoapClient sorgula = new KPSPublicSoapClient(KPSPublicSoapClient.EndpointConfiguration.KPSPublicSoap); ServiceResult result = new ServiceResult(); long tckimlikno = tckimlik; var dogumyilikaldir = dogumyili.Remove(0, 6); var dogumyil = Convert.ToInt32(dogumyilikaldir); string ad = adi.ToUpper(new System.Globalization.CultureInfo("tr-TR", false)); string soyad = soyadi.ToUpper(new System.Globalization.CultureInfo("tr-TR", false)); var sonuc = sorgula.TCKimlikNoDogrulaAsync(tckimlikno, ad, soyad, dogumyil); sonuc.Wait(); var vatandasMi = sonuc.Result.Body.TCKimlikNoDogrulaResult; if (vatandasMi == true) { var ismailexist = db.Kullanici.Any(x => x.KullaniciMaili == mailadresi); if (ismailexist == true) { result.Code = 0; result.Data = false; result.Message = "Bu mail daha önce alınmış"; return(result); } else { if (sifre1 == sifre2) { var kullanicisifre = sifre1; Guid g; g = Guid.NewGuid(); var guidkullanici = g.ToString(); var sifrelenecekveri = kullanicisifre + guidkullanici; var shasifre = ExtensionMethod.sha256(sifrelenecekveri); var yetki = Convert.ToInt32(YetkiTipi.Uye.Value); var ekleyen = Convert.ToInt32(kisi); KullaniciTbEkle(adi, soyadi, mailadresi, shasifre, guidkullanici, yetki, ekleyen, tckimlikno, dogumyil); result.Code = 1; result.Data = true; result.Message = "Uye kaydi tamamlanmistir.."; return(result); } else { result.Code = 2; result.Data = false; result.Message = "Sifreler uyusmadi.."; return(result); } } } else { result.Code = 3; result.Data = false; result.Message = "Böyle bir kişi bulunamadı"; return(result); } }
/// <summary> /// 获得删除规则的正则表达式形式 /// </summary> /// <returns></returns> internal List <Regex> GetDeleteFileLimitRuleSet() { if (this.DeleteFileLimits == null) { return(new List <Regex>()); } return(ExtensionMethod.ToList(Wrapper.ExtensionMethod.Select(DeleteFileLimits, s => new Regex(s, RegexOptions.IgnoreCase)))); }
public static void Start() { Console.WriteLine("CASE 03"); AutoMapperOperation.Start(); ExtensionMethod.Start(); CreateMethod.Start(); }
public void UpdateLogic() { Vector3 mousePosition = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, 10.0f)); Vector3Int cellPosition = tilemapGrid.WorldToCell(mousePosition); //Move Stone if (GameMrg.Ins.stone != null && GameMrg.Ins.getLogic.getCurStateType == GameLogic.Place) { //boundary if (tilemapGrid.WorldToCell(mousePosition).x > -23 && tilemapGrid.WorldToCell(mousePosition).x < 22 && tilemapGrid.WorldToCell(mousePosition).y > -8 && tilemapGrid.WorldToCell(mousePosition).y < 15) { GameMrg.Ins.stone.transform.position = tilemapGrid.CellToWorld(cellPosition); } } //Place Stone if (Input.GetButtonDown("Fire1") && GameMrg.Ins.getLogic.getCurStateType == GameLogic.Place && GameMrg.Ins.isMoveTower == false && GameMrg.Ins.stone != null) { //OverlapsCheck and findPath if (GridTile.Ins.pathfinder.isCanTower(cellPosition, GridTile.Ins.turningNode) && GridTile.Ins.OverlapCheck(cellPosition)) { string randomGemName = GameMrg.Ins.spawnRandom.RandomGetGemList(); if (GameMrg.Ins.gemInstantCount > 5) { GameMrg.Ins.getLogic.SetState(GameLogic.Keep); } else { ExtensionMethod.GameGemSpriteChange(randomGemName, GameMrg.Ins.stone); GridTile.Ins.AddBoardTower(cellPosition); GridTile.Ins.InhibitNode(cellPosition); GameSceneUI.Ins.uiPlace.newGemButton.SetActive(true); if (GameMrg.Ins.gemInstantCount >= 5) { GameMrg.Ins.getLogic.SetState(GameLogic.Keep); } else { GameMrg.Ins.getLogic.SetState(GameLogic.TowerSpawn); } } GameMrg.Ins.StonetoTower(randomGemName); GameMrg.Ins.stone = null; } else { GameSceneUI.Ins.BuildCannot(); } } }
public static async Task <Android.Graphics.Bitmap> GetBitmapFromImageSourceAsync(ImageSource source, Context context) { var handler = ExtensionMethod.GetHandler(source); var returnValue = (Android.Graphics.Bitmap)null; returnValue = await handler.LoadImageAsync(source, context); return(returnValue); }
private void UpdateFound_Load(object sender, EventArgs e) { if (Updater.Instance == null) { return; } var ctx = Updater.Instance.Context; var ui = ctx.UpdateInfo; lblFound.Text = ui.AppName; lblVersion.Text += ui.AppVersion; if (!string.IsNullOrEmpty(ui.WebUpdateNote)) { var wb = new WebBrowser() { Dock = DockStyle.Fill, ScrollBarsEnabled = true }; controlContainer.Controls.Add(wb); wb.Navigate(ui.WebUpdateNote); } else { var rtf = new RichTextBox() { ScrollBars = RichTextBoxScrollBars.Vertical, Dock = DockStyle.Fill, ReadOnly = true, BackColor = System.Drawing.SystemColors.Window, BorderStyle = BorderStyle.None }; if (!string.IsNullOrEmpty(ui.RtfUpdateNote)) { rtf.Rtf = System.Text.Encoding.UTF8.GetString(Wrapper.ExtensionMethod.Decompress(Convert.FromBase64String(ui.RtfUpdateNote))); } else { rtf.Text = ui.Desc; } controlContainer.Controls.Add(rtf); rtf.LinkClicked += rtf_LinkClicked; } var pkgSize = ExtensionMethod.Sum(Updater.Instance.PackagesToUpdate, s => s.PackageSize); lblSize.Text = string.Format(FSLib.App.SimpleUpdater.SR.UpdateFound_EstimateDownloadSize, (pkgSize == 0 ? SR.Unknown : ExtensionMethod.ToSizeDescription(pkgSize))); lnkSoft.Visible = !string.IsNullOrEmpty(ui.PublishUrl); if (ctx.MustUpdate) { //必须升级 lnkCance.Visible = false; } }
public bool Insert(Common.RoutingType routingType, int userId, Category category = null, Content content = null, Author author = null, Tag tag = null) { try { var defineRouting = new DefineRouting(); switch (routingType) { case Common.RoutingType.Category: { defineRouting.Controller = Constants.CategoryController; defineRouting.Action = Constants.CategoryAction; defineRouting.FriendlyUrlLv2 = NormalizeFriendlyUrl(routingType, ExtensionMethod.GenerateSlug(category.Title)); defineRouting.EntityId = category.CategoryId; break; } case Common.RoutingType.Content: { defineRouting.Controller = Constants.ContentController; defineRouting.Action = Constants.ContentAction; defineRouting.FriendlyUrlLv2 = NormalizeFriendlyUrl(routingType, ExtensionMethod.GenerateSlug(content.Title)); defineRouting.EntityId = content.ContentId; break; } case Common.RoutingType.Author: { defineRouting.Controller = Constants.AuthorController; defineRouting.Action = Constants.AuthorAction; defineRouting.FriendlyUrlLv2 = NormalizeFriendlyUrl(routingType, ExtensionMethod.GenerateSlug(string.Format("{0} {1}", author.FirstName.Trim(), author.LastName.Trim()))); defineRouting.EntityId = author.AuthorId; break; } case Common.RoutingType.Tag: { defineRouting.Controller = Constants.TagController; defineRouting.Action = Constants.TagAction; defineRouting.FriendlyUrlLv2 = NormalizeFriendlyUrl(routingType, ExtensionMethod.GenerateSlug(tag.TagName)); defineRouting.EntityId = tag.TagId; break; } } defineRouting.FriendlyUrlLv1 = routingType.ToString().ToLower(); defineRouting.CreatedUserId = defineRouting.UpdatedUserId = userId; _routingRepository.Create(defineRouting); return(true); } catch { return(false); } }
public void find_the_first_one_and_skip_second_one_and_take_other_positive_numbers() { var numbers = new List <int> { 1, 2, 3, 4, -5 }; var actual = ExtensionMethod.JoeyWhereWithIndex(numbers, (number, index) => index != 1 && number > 0); var expected = new List <int> { 1, 3, 4 }; expected.ToExpectedObject().ShouldMatch(actual); }
/// <summary> /// Cброс кэша ролевой модели для новой карточки /// </summary> public void ResetRolesCache(ObjectBase card) { ExtensionMethod extensionMethod = session.ExtensionManager.GetExtensionMethod("BackOfficeExtension", "ResetRolesCache"); if (extensionMethod == null) { return; } extensionMethod.Parameters.AddNew("cardId", ParameterValueType.Guid, GetCardId(card)); extensionMethod.Execute(); }
public async Task Should_GetSettlementPeriodEndTime_For_GivenSettlementPeriod() { await Task.Run(() => { //Arrange var settlementPeriod = 3; //Act var actualSettlementPeriodEndTime = ExtensionMethod.SettlementPeriodEndTime(settlementPeriod); var expectedSettlementPeriodEndTime = "01:30:00"; //Assert Assert.Equal(expectedSettlementPeriodEndTime, actualSettlementPeriodEndTime); }); }
protected override void OnPreviewGotKeyboardFocus(KeyboardFocusChangedEventArgs e) { base.OnPreviewGotKeyboardFocus(e); if (AutoSelectBehavior == AutoSelectBehavior.OnFocus) { // If the focus was not in one of our child ( or popup ), we select all the text. if (!ExtensionMethod.IsDescendantOf(e.OldFocus as DependencyObject, this)) { SelectAll(); } } }
public void ReadBtrForSeri(Database db, string fileName) { ExtensionMethod.ExecuteActionOnModelSpace(db, (tr, btrModelSpace) => { var jsonLineSetup = new JsonLineSetup(); var jsonBlockSetup = new JsonBlockSetup(); var jsonPID = new JsonPID(); InternalCounter = 1; foreach (ObjectId objectId in btrModelSpace) { using (var item = objectId.GetObject(OpenMode.ForWrite)) { if (item is BlockReference) { BlockReference blockReference = item as BlockReference; if (blockReference == null) { continue; } var btrObjectId = blockReference.DynamicBlockTableRecord; //must be Dynamic to find every blocks var blockDefinition = btrObjectId.GetObject(OpenMode.ForRead) as BlockTableRecord; if (blockDefinition.Name != "PID-PS-FRAME") { jsonPID.Blocks.Add(jsonBlockSetup.SetupBlockProperty(blockDefinition, tr, blockReference)); InternalCounter++; } } if (item == null) { continue; } if (item is Line || item is Polyline || item is Polyline2d || item is Polyline3d) { //jsonLineToSerialize.Add(jsonLineSetup.SetupLineProperty(item)); jsonPID.Lines.Add(jsonLineSetup.SetupLineProperty(item, jsonBlockSetup)); InternalCounter++; } } } jsonPID.Blocks.Sort(); jsonPID.Lines.Sort(); var seralizer = new JsonStringBuilderSerialize(); seralizer.StringBuilderSerialize(jsonPID, fileName); }); }
static void Main(string[] args) { Console.WriteLine("Test Azure Artifacts implementation \"Sample.Base.Core\""); string testValue = string.Empty; testValue = " "; testValue = testValue.TrimToEmpty(); Console.WriteLine($"TrimToEmpty-{testValue}-"); testValue = " "; testValue = testValue.TrimToNull(); Console.WriteLine($"TrimToNull-{testValue == null}-"); testValue = " "; var boolV = testValue.IsNullOrEmpty(); Console.WriteLine($"-{boolV}-"); var enuma = TestEnum.Enum1.test1; Console.WriteLine($"-{enuma.ToDescription()}-"); Console.WriteLine($"ToStringNum-{enuma.ToStringNum()}-"); IEnumerable <int?> enumInts = new int?[] { 10, 20, 30, 40, 50, 40 }; var ev = enumInts.ElementAtOrDefault(6, 100); Console.WriteLine("ev (is 100): " + ev); var ev1 = enumInts.IndexesWhere(a => a == 40); Console.WriteLine("IndexesWhere (is 3,5): " + string.Join(", ", ev1)); var cl = new TestEnum(); Console.WriteLine($"-{ ExtensionMethod.GetPropertyName( ()=> cl.ThisIsProperty)}-"); string firstFromSplitText = "abc,edf,hij"; Console.WriteLine("FirstFromSplit (abc,edf,hij): " + firstFromSplitText.FirstFromSplit(",")); DateTime dtNow = DateTime.Now; Console.WriteLine("datetime12: " + DateTimeExtensions.ToFormat12h(dtNow)); Console.WriteLine("datetime24: " + DateTimeExtensions.ToFormat24h(dtNow)); Console.WriteLine("End Test"); }
public void NextFloor() { int idx = GameMng.Ins.currentTileIdx; int stageIdx = GameMng.Ins.StageNum; //GameMng.Ins.tile[idx].bStageClear[stageIdx] == false || if (stageIdx >= GameMng.Ins.tile[GameMng.Ins.currentTileIdx].bStageClear.Count) { StartCoroutine(PopupText()); //Debug.LogError("마지막 층"); return; } //BattleUIMng.Ins.stageReward.SetVisible(false); SetVisible(false); //던전 재입장 카메라 위치 Camera.main.transform.eulerAngles = BattleMng.Ins.waitCameraRotX; Camera.main.transform.position = BattleMng.Ins.waitCameraPos; for (int i = 0; i < BattleMng.Ins.heroDatas.Count; ++i) { BattleMng.Ins.heroList[i].gameObject.SetActive(true); BattleMng.Ins.heroList[i].transform.position = BattleMng.Ins.heroRespawn[i].position; BattleMng.Ins.heroList[i].Init(); BattleMng.Ins.heroList[i].SetData(); BattleMng.Ins.heroSpawnEffect[i].gameObject.SetActive(true); } BattleUIMng.Ins.hitText.Init(); SkillMng.Ins.Clear(); //hero hp BattleUIMng.Ins.heroinfo.SetInfo(); //다음 스테이지 몬스터로 바꿔주고 eMonster eMonster = (eMonster)Enum.Parse(typeof(eMonster), BattleMng.Ins.sMonsterName); int temp = (int)eMonster + monsterNum; eMonster = (eMonster)temp; BattleMng.Ins.sMonsterName = eMonster.ToString(); //스테이지 보상 다시 셋팅 BattleMng.Ins.stageRewardData = ExtensionMethod.GetStageRewardData(GameMng.Ins.StageNum); BattleMng.Ins.StartCoroutine(BattleMng.Ins.StartDungeon()); }
//stone에게 tower에 table값을 넣어줌 public void StonetoTower(string name) { Tower stoneTower = stone.GetComponent <Tower>(); stoneTower.createTowerNumber = gemInstantCount - 1; stoneTower.SetTowerData(ExtensionMethod.GetTowerTb(name), gemInstantCount - 1); //createtower 추가하고 GameSceneUi의 sprite를 바꿔준다 createTowerList.Add(stone); createTower[gemInstantCount - 1] = stoneTower; ChangeItemUiSprite(); }
static Updater() { var ass = System.Reflection.Assembly.GetExecutingAssembly(); var location = ass.Location; if (!string.IsNullOrEmpty(location)) { UpdaterClientVersion = ExtensionMethod.ConvertVersionInfo(System.Diagnostics.FileVersionInfo.GetVersionInfo(location)).ToString(); } else { UpdaterClientVersion = "0.0.0.0"; } }
public void ReadBlockTableRecord(Database db) { ExtensionMethod.ExecuteActionOnModelSpace(db, (tr, btrModelSpace) => { foreach (ObjectId objectId in btrModelSpace) { using (var blockReference = tr.GetObject(objectId, OpenMode.ForRead) as BlockReference) { if (blockReference == null) { continue; } var btrObjectId = blockReference.DynamicBlockTableRecord; //must be Dynamic to find every blocks using (var blockDefinition = btrObjectId.GetObject(OpenMode.ForRead) as BlockTableRecord) { //System.Diagnostics.Debug.Print(blockDefinition.Name); //if (blockDefinition.Name == "RefPIDDenit$0$reactor") //{ // System.Diagnostics.Debug.Print("STOP! Hammertime!"); //} var jsonBlockProperty = new JsonBlockProperty(); if (!blockDefinition.IsAnonymous && !blockDefinition.IsLayout) { //jsonBlockProperty.Misc = new Misc(blockName: blockDefinition.Name, rotation: 0); } if (blockReference.IsDynamicBlock) { foreach (DynamicBlockReferenceProperty dbrProp in blockReference.DynamicBlockReferencePropertyCollection) { } } foreach (ObjectId BlockObjectId in blockDefinition) { var entity = tr.GetObject(BlockObjectId, OpenMode.ForWrite) as Autodesk.AutoCAD.DatabaseServices.Entity; if (entity == null) { continue; } } } } } }); }
public async Task Should_GetSettlementPeriodForBOALF_When_Passing_TimeTo_And_TimeFrom_4() { await Task.Run(() => { //Arrange var timeFrom = new DateTime(2018, 11, 10, 2, 00, 00); var timeTo = new DateTime(2018, 11, 10, 2, 30, 00); //Act var actualSettlementPeriod = ExtensionMethod.GetSettlementPeriodForBv(timeTo, timeFrom); var expectedSettlementPeriod = 5; //Assert Assert.Equal(expectedSettlementPeriod, actualSettlementPeriod); }); }
public async Task <bool> DeleteItemInBasket(int id) { var userId = ExtensionMethod.GetUserId(_httpContextAccessor.HttpContext); if (userId == null) { throw new ArgumentNullException("userId invalied"); } var basket = await _basketRepository.GetAsync(userId); basket.DeleteItemToBasket(id); await _basketRepository.UnitOfWork.SaveChangesAsync(); return(true); }
public int ReturnGem(int stage) { int gem = 0; var data = ExtensionMethod.GetQuestRewardData(stage); if (data == null) { gem = -1; } gem = data.nRewardGem; return(gem); }
public ServiceResult BenimlePaylasilanlarBilgi(string id, string session) { ServiceResult result = new ServiceResult(); if (String.IsNullOrWhiteSpace(id) || id == "none") { result.Code = 0; result.Data = "Bir dosya secimi yapılmadı!!! Lutfen bilgisini gormek istediginiz dosyayi seciniz.."; return(result); } string[] parcalar = ExtensionMethod.Parcala(id); var adet = parcalar.Length; var kullaniciid = Convert.ToInt32(session); var yetkiadi = ""; List <string> kullaniciliste = new List <string>(); for (int i = 0; i < parcalar.Length; i++) { var istedigimid = Convert.ToInt32(parcalar[i]); var eris = db.Paylasilanlar.Where(m => m.DosyaId == istedigimid && m.Durumu == null && m.PaylasilanKisi == kullaniciid).SingleOrDefault(); if (eris == null) { result.Code = 4; result.Message = "Hiç bir kayıt bulunamadı"; return(result); } var dosyaismi = eris.Adi; var sharetime = eris.PaylasilmaTarihi; var yetki = Convert.ToInt32(eris.Yetki); if (yetki == 1) { yetkiadi = "Önizleme"; } else if (yetki == 2) { yetkiadi = "İndirme"; } else if (yetki == 3) { yetkiadi = "Önizleme & İndirme"; } var kullaniciismi = eris.Kullanici.KullaniciAdi; kullaniciliste.Add("<tr><td>" + kullaniciismi + "</td>" + "<td>" + dosyaismi + "</td>" + "<td>" + sharetime + "</td>" + "<td>" + yetkiadi + "</td>" + "</tr>"); } result.Code = 1; result.Data = kullaniciliste; return(result); }
void HeroLevel() { var heroData = heroDatas.GetEnumerator(); if (stageRewardData == null) { Debug.LogError("error"); return; } int idx = 0; while (heroData.MoveNext()) { var data = heroData.Current; int nHeroMaxExp = ExtensionMethod.GetHeroLevelData(data.nLevel); int stageRewardExp = stageRewardData.nExp;; repeatCount = 0; data.nExp += stageRewardExp; //현재 경험치에 스테이지 보상 경험치를 더한 값이 현재 레벨에 맥스 경험치보다 같거나 크면 if (data.nExp >= nHeroMaxExp) { ++data.nLevel; ++repeatCount; while (data.nExp > nHeroMaxExp) { data.nExp -= nHeroMaxExp; nHeroMaxExp = ExtensionMethod.GetHeroLevelData(data.nLevel); if (data.nExp >= nHeroMaxExp) { ++data.nLevel; ++repeatCount; } } } var expUI = BattleUIMng.Ins.stageReward.heroExpBar; expUI[idx].ExpUp(repeatCount, nHeroMaxExp, data.nExp, stageRewardExp); ++idx; } }
public void LevelUp() { if (GameMrg.Ins.selectTower != null) { if ((enumTower)GameMrg.Ins.selectTower.eId != enumTower.Stone) { if (GameMrg.Ins.selectTower.eId / 10 < 3) { if (GameMrg.Ins.money > GameMrg.Ins.selectTower.levelUpcost) { int downId = (GameMrg.Ins.selectTower.eId / 10) + 1; int kind = GameMrg.Ins.selectTower.eId % 10; int changeTowerNumber = (downId * 10) + kind; enumTower towerId = (enumTower)changeTowerNumber; string towerIdToDesc = towerId.ToDesc(); Tower changeTower = new Tower(); var tbData = ExtensionMethod.GetTowerTb(towerIdToDesc); GameMrg.Ins.selectTower.eId = (int)tbData.eID; GameMrg.Ins.selectTower.damage = tbData.damage; GameMrg.Ins.selectTower.attackSpeed = tbData.attackSpeed; GameMrg.Ins.selectTower.range = tbData.range; GameMrg.Ins.selectTower.towerName = tbData.towerName; GameMrg.Ins.selectTower.bulletSpeed = tbData.bulletSpeed; GameMrg.Ins.selectTower.levelUpcost = tbData.levelUpcost; ExtensionMethod.GameGemSpriteChange(GameMrg.Ins.selectTower.towerName, GameMrg.Ins.selectTower.gameObject); SetInfoUI(); } else { GameSceneUI.Ins.centerUiLabel.text = "Not enough money"; GameSceneUI.Ins.CenterLabelOnWaitOff(); } } else { GameSceneUI.Ins.centerUiLabel.text = "Stone impossible level up "; GameSceneUI.Ins.CenterLabelOnWaitOff(); } } else { GameSceneUI.Ins.centerUiLabel.text = "Already is tower maximum the level"; GameSceneUI.Ins.CenterLabelOnWaitOff(); } } }
protected void ddlMake_SelectedIndexChanged(object sender, EventArgs e) { try { master.IsSessionAvailable(); var service = CommonMethods.GetLogedInService(); string VehicleMake = ddlMake.SelectedItem.Value; var vehicleModel = service.GetData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper <BKIC.SellingPoint.DTO.RequestResponseWrappers.VehicleModelResponse> >( BKIC.SellingPoint.DTO.Constants.DropDownURI.GetVehicleModel .Replace("{vehicleMake}", VehicleMake)); if (vehicleModel.StatusCode == 200 && vehicleModel.Result.IsTransactionDone) { if (ddlMake.SelectedIndex > 0) { DataTable vehicleModeldt = JsonConvert.DeserializeObject <DataTable>(vehicleModel.Result.VehicleModeldt); if (vehicleModeldt != null && vehicleModeldt.Rows.Count > 0) { ddlModel.DataSource = ExtensionMethod.GetDistictModel(SubClass, vehicleModeldt); ddlModel.DataValueField = "Model"; ddlModel.DataTextField = "Model"; ddlModel.DataBind(); ddlModel.Items.Insert(0, new ListItem("--Please Select--", "")); } ddlBodyType.SelectedItem.Text = string.Empty; } else { ddlModel.SelectedIndex = -1; } } // DisableControls(); } catch (Exception ex) { //throw ex; } finally { master.ShowLoading = false; } }
private void OtherTowerChangeStone() { for (int i = 0; i < createTower.Count; i++) { if (selectTower.createTowerNumber != i && createTower[i] != null) { var tbData = ExtensionMethod.GetTowerTb(enumTower.Stone.ToDesc()); createTower[i].eId = (int)tbData.eID; createTower[i].damage = tbData.damage; createTower[i].range = tbData.range; createTower[i].towerName = tbData.towerName; createTower[i].attackSpeed = tbData.attackSpeed; createTower[i].levelUpcost = tbData.levelUpcost; createTower[i].isCombineTower = false; ExtensionMethod.GameGemSpriteChange(createTower[i].towerName, createTower[i].gameObject); } } }
public HttpResponseMessage GetProductsById(int id) { var entity = _context.Products.FirstOrDefault(p => p.ID == id); if (entity != null) { return(Request.CreateResponse(HttpStatusCode.OK, entity)); } else { Response res = new Response(); res.error = 1; res.errorMessage = "Product with Id = " + id.ToString() + " not found."; res.count = 0; string response = ExtensionMethod.ToJSON(res); return(Request.CreateErrorResponse(HttpStatusCode.NotFound, response)); } }
/// <summary> /// See <see cref="Visitor.VisitExtensionMethod"/>. /// </summary> public override void VisitExtensionMethod(ExtensionMethod method) { if (delegates.VisitExtensionMethod != null) delegates.VisitExtensionMethod(method); base.VisitExtensionMethod(method); }
public virtual void VisitExtensionMethod(ExtensionMethod method) { VisitMember(method); }
private void Initialize_impl(Type type, string methodName, List<MethodBase> methods) { m_Type = type; m_MethodName = methodName; List<FunctionBase> functionMethod = new List<FunctionBase>(); List<FunctionBase> genericMethods = new List<FunctionBase>(); bool Params = false; //是否是不定参函数 Type ParamType = null; //不定参类型 ParameterInfo[] Parameters; //所有参数 List<Type> parameterTypes = new List<Type>(); //参数类型 List<object> defaultParameter = new List<object>(); //默认参数 int length = methods.Count; //总数量 MethodBase method = null; FunctionBase functionBase; for (int i = 0; i < length; ++i) { method = methods[i]; Params = false; ParamType = null; parameterTypes.Clear(); defaultParameter.Clear(); Parameters = method.GetParameters(); if (Util.IsExtensionMethod(method)) { for (int j = 1; j < Parameters.Length; ++j) { var par = Parameters[j]; parameterTypes.Add(par.ParameterType); if (par.DefaultValue != DBNull.Value) { defaultParameter.Add(par.DefaultValue); } Params = Util.IsParamArray(par); if (Params) ParamType = par.ParameterType.GetElementType(); } functionBase = new ExtensionMethod(method as MethodInfo, parameterTypes.ToArray(), defaultParameter.ToArray(), ParamType, Params, ""); } else { foreach (ParameterInfo par in Parameters) { parameterTypes.Add(par.ParameterType); if (par.DefaultValue != DBNull.Value) { defaultParameter.Add(par.DefaultValue); } Params = Util.IsParamArray(par); if (Params) ParamType = par.ParameterType.GetElementType(); } if (method is MethodInfo) functionBase = new FunctionMethod(method as MethodInfo, parameterTypes.ToArray(), defaultParameter.ToArray(), ParamType, Params, ""); else functionBase = new FunctionConstructor(method as ConstructorInfo, parameterTypes.ToArray(), defaultParameter.ToArray(), ParamType, Params, ""); } if (functionBase.IsGeneric) genericMethods.Add(functionBase); else functionMethod.Add(functionBase); } m_Methods = functionMethod.ToArray(); m_Count = m_Methods.Length; m_GenericMethods = genericMethods.ToArray(); m_GenericCount = m_GenericMethods.Length; }