public string AddMember(string data) { if (!Request.IsAuthenticated || StaticMethod.GetType(UserID) != 0) { return(JsonConvert.SerializeObject(new ReturnResponse(24000, "身份验证未通过"))); } Users user = JsonConvert.DeserializeObject <Users>(data); user.user_pwd = Security.EncryptQueryString("123456"); user.user_reg_ip = StaticMethod.GetClientIP(); user.user_reg_time = DateTime.Now; using (var db = new DoCoverEntities()) { if (db.Users.Count(m => m.user_name == user.user_name) > 0) { return(JsonConvert.SerializeObject(new ReturnResponse() { code = 31001, message = "用户名重复" })); } db.Users.Add(user); db.SaveChanges(); } return(JsonConvert.SerializeObject(new ReturnResponse(200))); }
public void UpdateCardDisplay(params object[] args) { string cardID = (string)args[0]; if (cardID == "0" || cardID == "") { return; } XmlCard card = LoadXml.GetXmlCard(cardID); string star = ""; rawImage.texture = StaticMethod.GetCardPics(cardID, false); effectText.text = card.cardDescribe; nameText.text = "[" + card.cardName.ToString() + "]" + "\n"; nameText.text += "[" + card.cardType + "]"; if (card.IsMonster()) { for (int i = 0; i < card.level; i++) { star = star + "★"; } nameText.text += " " + card.race + "/" + card.attribute + "\n"; nameText.text += "[" + star + "]" + " " + card.afk + "/" + card.def; } }
/// <summary> /// 设置放置的方式 /// </summary> /// <param name="cardPutType"></param> public void SetPutType(int cardPutType, string cardID) { switch (cardPutType) { case ComVal.CardPutType_UpRightFront: image.rectTransform.localEulerAngles = new Vector3(0, 0, 0); selectAnim.GetComponent <RectTransform>().localEulerAngles = new Vector3(0, 0, 0); image.texture = StaticMethod.GetCardPics(cardID, true); break; case ComVal.CardPutType_UpRightBack: image.rectTransform.localEulerAngles = new Vector3(0, 180, 0); selectAnim.GetComponent <RectTransform>().localEulerAngles = new Vector3(0, 180, 0); image.texture = coverTexture; break; case ComVal.CardPutType_layFront: image.rectTransform.localEulerAngles = new Vector3(180, 0, 90); selectAnim.GetComponent <RectTransform>().localEulerAngles = new Vector3(180, 0, 90); image.texture = StaticMethod.GetCardPics(cardID, true); break; case ComVal.CardPutType_layBack: image.rectTransform.localEulerAngles = new Vector3(180, 0, 90); selectAnim.GetComponent <RectTransform>().localEulerAngles = new Vector3(180, 0, 90); image.texture = coverTexture; break; } myPutType = cardPutType; CheckVisual(cardPutType); }
public string UpdatePassword(string oldPassword, string newPassword) { if (!Request.IsAuthenticated) { return(JsonConvert.SerializeObject(new ReturnResponse(24000, "身份验证未通过"))); } try { using (var db = new DoCoverEntities()) { Users user = db.Users.FirstOrDefault(m => m.user_id == UserID); if (user.user_pwd != Security.EncryptQueryString(oldPassword)) { return(JsonConvert.SerializeObject(new ReturnResponse(24001, "当前密码不正确"))); } user.user_pwd = Security.EncryptQueryString(newPassword); user.user_last_update_ip = StaticMethod.GetClientIP(); user.user_last_update_time = DateTime.Now; db.SaveChanges(); } return(JsonConvert.SerializeObject(new ReturnResponse(200))); } catch (Exception ex) { return(JsonConvert.SerializeObject(new ReturnResponse(25001, ex.Message))); } }
private async void OnLoaded(object sender, RoutedEventArgs routedEventArgs) { MovingRect.Begin(); await StaticMethod.LoadDataTask(); this.Frame.Navigate(typeof(FunctionSelectPage)); }
public string EditMemberStatus(int user_id, bool user_status, string user_remark = "") { if (!Request.IsAuthenticated || StaticMethod.GetType(UserID) != 0) { return(JsonConvert.SerializeObject(new ReturnResponse(24000, "身份验证未通过"))); } using (var db = new DoCoverEntities()) { Users user = db.Users.FirstOrDefault(m => m.user_id == user_id); if (user == null) { return(JsonConvert.SerializeObject(new ReturnResponse() { code = 31002, message = "该用户不存在" })); } user.user_status = user_status; user.user_remark = user_remark; user.user_last_update_ip = StaticMethod.GetClientIP(); user.user_last_update_time = DateTime.Now;; db.SaveChanges(); } return(JsonConvert.SerializeObject(new ReturnResponse(200))); }
public string UpdateInfo(string data) { if (!Request.IsAuthenticated) { return(JsonConvert.SerializeObject(new ReturnResponse(24000, "身份验证未通过"))); } try { Users info = JsonConvert.DeserializeObject <Users>(data); using (var db = new DoCoverEntities()) { Users user = db.Users.FirstOrDefault(m => m.user_id == UserID); user.user_nick_name = info.user_nick_name; user.user_qq = info.user_qq; user.user_phone = info.user_phone; user.user_email = info.user_email; user.user_last_update_ip = StaticMethod.GetClientIP(); user.user_last_update_time = DateTime.Now; db.SaveChanges(); } return(JsonConvert.SerializeObject(new ReturnResponse(200))); } catch (Exception ex) { return(JsonConvert.SerializeObject(new ReturnResponse(25001, ex.Message))); } }
private void GoogleTileLayerOnGetTileUri(object sender, GetTileUriEventArgs getTileUriEventArgs) { getTileUriEventArgs.Uri = new Uri(string.Format(@"http://mts{0}.google.com/vt/lyrs={1}&z={2}&x={3}&y={4}", 1, StaticMethod.GetSettings("mapStyleKey"), getTileUriEventArgs.LevelOfDetail, getTileUriEventArgs.X, getTileUriEventArgs.Y)); }
private void MapStyleMenuFlyoutItem_OnTapped(object sender, TappedRoutedEventArgs e) { MenuFlyoutItem selectedItem = sender as MenuFlyoutItem; int selectedIndex = Convert.ToInt32(selectedItem.Tag); string key = ""; switch (selectedIndex) { case 1: //Drawing Map style key = "m"; break; case 2: //Hybrid Map style key = "y"; break; default: key = "m"; break; } StaticMethod.SetSettings("mapStyleKey", key); LoadMapStyle(); }
public string DelMember(int user_id) { if (!Request.IsAuthenticated || StaticMethod.GetType(UserID) != 0) { return(JsonConvert.SerializeObject(new ReturnResponse(24000, "身份验证未通过"))); } using (var db = new DoCoverEntities()) { Users user = db.Users.FirstOrDefault(m => m.user_id == user_id); if (user == null) { return(JsonConvert.SerializeObject(new ReturnResponse() { code = 31002, message = "该用户不存在" })); } if ((user.Orders_Create != null && user.Orders_Create.Count > 0) || (user.Orders_Finish != null && user.Orders_Finish.Count > 0)) { return(JsonConvert.SerializeObject(new ReturnResponse() { code = 21001, message = "该用户有关联订单,推荐使用禁用功能" })); } db.Users.Remove(user); db.SaveChanges(); } return(JsonConvert.SerializeObject(new ReturnResponse(200))); }
public async Task LoadData(string cat) { string temp = ""; if (!StaticData.isOfflineMode) { temp = await StaticMethod.GetHttpAsString( "http://voucherworld.azurewebsites.net/api/routes?lat=10.8221&lon=106.6876&distance=5&cat=" + cat); } else { temp = "[{\"Id\":1,\"Name\":\"KFC\",\"IsHidden\":false,\"Category\":0,\"Distance\":4.6274461736471313,\"Gift\":{\"Id\":1,\"GiftName\":\"Name of Gift_0\",\"Images\":[]},\"PlaceIcon\":\"http://mohinhgiayvn.com/diendan/favicon.ico\",\"Question\":{\"Id\":1,\"Content\":\"Open-ended question for route0\"},\"Place\":{\"Id\":1,\"Name\":\"Place 01\",\"Address\":\"\u0110\u01af\u1edcNG Ph\u1ea1m Ng\u1ecdc Th\u1ea1ch 4, Ho Chi Minh City, Vietnam\",\"BonusPoint\":0,\"Longitude\":106.697502,\"Latitude\":10.781637,\"Altitude\":0.0,\"Question\":null},\"Merchant\":{\"Id\":1,\"Name\":\"KFC\",\"Address\":\"KFC Manager Address\",\"PhoneNumber\":\"0123456789\",\"Website\":\"http://bing.com/\"}},{\"Id\":3,\"Name\":\"Burger King Phan X\u00edch Long\",\"IsHidden\":false,\"Category\":0,\"Distance\":2.6985724393301647,\"Gift\":{\"Id\":3,\"GiftName\":\"Name of Gift_2\",\"Images\":[]},\"PlaceIcon\":\"http://mohinhgiayvn.com/diendan/favicon.ico\",\"Question\":{\"Id\":3,\"Content\":\"Open-ended question for route2\"},\"Place\":{\"Id\":7,\"Name\":\"Place 07\",\"Address\":\"Nh\u00e0 d\u00e2n\",\"BonusPoint\":0,\"Longitude\":106.688885,\"Latitude\":10.797864,\"Altitude\":0.0,\"Question\":null},\"Merchant\":{\"Id\":2,\"Name\":\"BurgerKing\",\"Address\":\"BurgerKing Manager Address\",\"PhoneNumber\":\"0123456789\",\"Website\":\"http://bing.com/\"}},{\"Id\":4,\"Name\":\"Burger King C\u00e1ch m\u1ea1ng th\u00e1ng T\u00e1m\",\"IsHidden\":false,\"Category\":0,\"Distance\":4.8649979690515739,\"Gift\":{\"Id\":4,\"GiftName\":\"Name of Gift_3\",\"Images\":[]},\"PlaceIcon\":\"http://mohinhgiayvn.com/diendan/favicon.ico\",\"Question\":{\"Id\":4,\"Content\":\"Open-ended question for route3\"},\"Place\":{\"Id\":10,\"Name\":\"Place 10\",\"Address\":\"C\u00e2u l\u1ea1c b\u1ed9 Lan Anh\",\"BonusPoint\":0,\"Longitude\":106.678316,\"Latitude\":10.779309,\"Altitude\":0.0,\"Question\":null},\"Merchant\":{\"Id\":2,\"Name\":\"BurgerKing\",\"Address\":\"BurgerKing Manager Address\",\"PhoneNumber\":\"0123456789\",\"Website\":\"http://bing.com/\"}},{\"Id\":7,\"Name\":\"VIC Coconut\",\"IsHidden\":false,\"Category\":0,\"Distance\":0.10380183976916138,\"Gift\":{\"Id\":7,\"GiftName\":\"Coconut-covered Ice Cream\",\"Images\":[]},\"PlaceIcon\":\"http://mohinhgiayvn.com/diendan/favicon.ico\",\"Question\":{\"Id\":7,\"Content\":\"Which flavour do you like most?\"},\"Place\":{\"Id\":21,\"Name\":\"Kem Vi\u1ec7t Nguy\u1ec5n V\u0103n Nghi\",\"Address\":\"Kem Vi\u1ec7t Nguy\u1ec5n V\u0103n Nghi\",\"BonusPoint\":0,\"Longitude\":106.6885,\"Latitude\":10.8218,\"Altitude\":0.0,\"Question\":null},\"Merchant\":{\"Id\":4,\"Name\":\"Vi\u1ec7t Ice Cream\",\"Address\":\"Vi\u1ec7t Ice Cream Address\",\"PhoneNumber\":\"0866772508\",\"Website\":\"http://vieticecream.com\"}},{\"Id\":10,\"Name\":\"Vi\u1ec7t Ice Cream Nguy\u1ec5n V\u0103n Nghi\",\"IsHidden\":false,\"Category\":0,\"Distance\":0.16597340240899303,\"Gift\":{\"Id\":10,\"GiftName\":\"Chocolate Ice Cream\",\"Images\":[]},\"PlaceIcon\":null,\"Question\":{\"Id\":10,\"Content\":\"Which flavour do you like most\"},\"Place\":{\"Id\":19,\"Name\":\"47 Nguy\u1ec5n V\u0103n Nghi, P4, G\u00f2 V\u1ea5p\",\"Address\":\"47 Nguy\u1ec5n V\u0103n Nghi, P4, G\u00f2 V\u1ea5p\",\"BonusPoint\":0,\"Longitude\":106.6872,\"Latitude\":10.82354,\"Altitude\":0.0,\"Question\":null},\"Merchant\":{\"Id\":4,\"Name\":\"Vi\u1ec7t Ice Cream\",\"Address\":\"Vi\u1ec7t Ice Cream Address\",\"PhoneNumber\":\"0866772508\",\"Website\":\"http://vieticecream.com\"}}]"; } JArray jArray = JArray.Parse(temp); //RouteCollection = jObject.ToObject<ObservableCollection<Route>>(); RouteCollection = jArray.ToObject <ObservableCollection <Route> >(); foreach (Enrrollments errollmentse in StaticData.ErrollmentHistory) { int routeId = errollmentse.Id; for (int i = RouteCollection.Count - 1; i >= 0; i--) { if (RouteCollection[i].Id == routeId) { RouteCollection.RemoveAt(i); } } } }
void geolocator_PositionChanged(Geolocator sender, PositionChangedEventArgs args) { Dispatcher.BeginInvoke(() => { //LatitudeTextBlock.Text = args.Position.Coordinate.Latitude.ToString("0.00000000"); //LongitudeTextBlock.Text = args.Position.Coordinate.Longitude.ToString("0.00000000"); GeoCoordinate currentCoordinate = new GeoCoordinate(args.Position.Coordinate.Latitude, args.Position.Coordinate.Longitude); currCoordinate = currentCoordinate; MainMap.SetView(currentCoordinate, MainMap.ZoomLevel); HeadingPath.Visibility = Visibility.Visible; SecretTestPath.Visibility = Visibility.Visible; GeoCoordinate diamondCoordinate = new GeoCoordinate(StaticViewModel.MapViewModel.currentPlace.Latitude, StaticViewModel.MapViewModel.currentPlace.Longitude); if (StaticMethod.Distance(currentCoordinate, diamondCoordinate) <= 0.1) { DiamondControl tempDiamondControl = diamondOverlay.Content as DiamondControl; tempDiamondControl.ChangeColor(); CollectGrid.Visibility = Visibility.Visible; } else { CollectGrid.Visibility = Visibility.Collapsed; } }); }
//다음 스펙값 반환 => 1레벨수치+ (1레벨수치*0.05*(현재레벨-1)) public static float Get_nextSpec(float InitSpec, int nextRefLv, bool isRound, float ratio = 0.05f, int constVal = 1) { //float ratio = Dic_infosRank[st_UnitInfo.InfosUnit.UnitRk].AddAblty / 1000f; float Calspec = 0; float _ratio = ratio; float refv = (float)nextRefLv; if (InitSpec != 0) // 다음능력치 = 최초능력치 + (최초능력치 * 비율 * (강화레벨-const)) { Calspec = InitSpec + (InitSpec * (_ratio) * (refv - constVal)); } else // 다음능력치 비율 * (강화레벨-const) { Calspec = (_ratio) * (refv - constVal); } float _nextSpec = 0; if (isRound) { //_nextSpec = (float)Math.Round(Calspec, MidpointRounding.AwayFromZero); _nextSpec = StaticMethod.roundFloat(Calspec, 1); } else { //float v = (float)Math.Round((Calspec / 0.1f), 2); //_nextSpec = (float)Math.Round(v * 0.1f, 2); _nextSpec = StaticMethod.roundFloat(Calspec, 2); } return(_nextSpec); }
private async Task GetRouteDetails(string Id) { string temp = ""; if (!StaticData.isOfflineMode) { temp = await StaticMethod.GetHttpAsString("http://voucherworld.azurewebsites.net/api/routes?id=" + Id); } else { temp = "{\"Id\":10,\"Name\":\"Vi\u1ec7t Ice Cream Nguy\u1ec5n V\u0103n Nghi\",\"IsHidden\":false,\"Category\":0,\"Gift\":{\"Id\":10,\"GiftName\":\"Chocolate Ice Cream\",\"Images\":[]},\"PlaceIcon\":null,\"Question\":{\"Id\":10,\"Content\":\"Which flavour do you like most\"},\"Places\":[{\"Id\":19,\"Name\":\"47 Nguy\u1ec5n V\u0103n Nghi, P4, G\u00f2 V\u1ea5p\",\"Address\":\"47 Nguy\u1ec5n V\u0103n Nghi, P4, G\u00f2 V\u1ea5p\",\"BonusPoint\":5,\"Longitude\":106.6872,\"Latitude\":10.82354,\"Altitude\":0.0,\"Question\":{\"Id\":19,\"Content\":\"Are Vi\u1ec7t Ice Cream\'s employees friendly?\"}},{\"Id\":20,\"Name\":\"Tr\u01b0\u1eddng \u0110\u1ea1i h\u1ecdc C\u00f4ng nghi\u1ec7p, TP.HCM\",\"Address\":\"Tr\u01b0\u1eddng \u0110\u1ea1i h\u1ecdc C\u00f4ng nghi\u1ec7p, TP.HCM\",\"BonusPoint\":5,\"Longitude\":106.6882,\"Latitude\":10.8226,\"Altitude\":0.0,\"Question\":{\"Id\":20,\"Content\":\"How does Milk-Coconut flavour satisfy you?\"}},{\"Id\":21,\"Name\":\"Kem Vi\u1ec7t Nguy\u1ec5n V\u0103n Nghi\",\"Address\":\"Kem Vi\u1ec7t Nguy\u1ec5n V\u0103n Nghi\",\"BonusPoint\":5,\"Longitude\":106.6885,\"Latitude\":10.8218,\"Altitude\":0.0,\"Question\":{\"Id\":21,\"Content\":\"Is Vi\u1ec7t Ice Cream\'s website friendly?\"}}],\"Merchant\":{\"Id\":4,\"Name\":\"Vi\u1ec7t Ice Cream\",\"Address\":\"Vi\u1ec7t Ice Cream Address\",\"PhoneNumber\":\"0866772508\",\"Website\":\"http://vieticecream.com\"}}"; } //string temp = // "{\"RouteId\":1,\"Name\":\"KFC\",\"Category\":0,\"Gifts\":[{\"GiftId\":1,\"GiftName\":\"Name of Gift_0\",\"InfoImages\":[],\"RouteId\":1}],\"Places\":[{\"PlaceId\":1,\"Longitude\":106.697502,\"Latitude\":10.781637,\"Altitude\":null,\"Address\":\"ĐƯỜNG Phạm Ngọc Thạch 4, Ho Chi Minh City, Vietnam\",\"PlaceType\":0},{\"PlaceId\":2,\"Longitude\":106.697715,\"Latitude\":10.78103,\"Altitude\":null,\"Address\":\"ĐƯỜNG Phạm Ngọc Thạch 1, Ho Chi Minh City, Vietnam\",\"PlaceType\":1},{\"PlaceId\":3,\"Longitude\":106.698342,\"Latitude\":10.781088,\"Altitude\":null,\"Address\":\"Diamond Plaza, tầng 5\",\"PlaceType\":2}]}"; JObject jObject = JObject.Parse(temp); StaticViewModel.MapViewModel.RouteDetailsModel = jObject.ToObject <RouteDetailsModel>(); StaticData.CurrentErrollments = jObject.ToObject <Enrrollments>(); InitializeUI(); }
public void OnFindButtonClick() { string keyWord = keyWordInputField.text; int cardType = StaticMethod.ChangeCardType(cardTypeDropdown.captionText.text); int cardRace = StaticMethod.ChangeCardRace(cardRaceDropdown.captionText.text); int cardAttr = StaticMethod.ChangeCardAttr(cardAttrDropdown.captionText.text); string str = cardLevelDropdown.captionText.text; int cardLevel = 0; if (str != "N/A") { str = str.Replace("星", ""); cardLevel = int.Parse(str); } if (!ComVal.isMonster(cardType)) { if (cardRace != 0 || cardAttr != 0 || cardLevel != 0) { return; } } editUI.FindCard(cardType, cardAttr, cardRace, cardLevel, keyWord); }
public void Play(string id, normalDele dele, int cardCount) { rectTransform.localPosition = localPosition; rectTransform.localEulerAngles = localEulerAngles; rectTransform.localScale = Vector3.one; gameObject.SetActive(true); image.overrideSprite = cover; cardSprite = StaticMethod.GetCardSprite(id, true); isMove = true; Tweener t = image.rectTransform.DOLocalRotate(targetEulerAngles, 0.2f); float val = cardCount > 7 ? x * 8 : x * (cardCount + 1); if (!isMy) { val = -val; } Tweener t1 = image.rectTransform.DOLocalMove(new Vector3(val, targetPosition.y, targetPosition.z), 0.2f); Tweener t2 = image.rectTransform.DOScale(new Vector3(1.5f, 1.5f, 1), 0.3f); t1.onComplete = delegate { isMove = false; gameObject.SetActive(false); if (dele != null) { dele(); } }; }
//로그인 완료~ 필요정보 받기 void Get_necessaryInfo() { User _user = UserDataManager.instance.user; //로그인 완료됫당 isCompleteLogin = true; //플랫폼매니저에 현재플랫폼인덱스 저장 ===> 완전히 로그인이 완료 될때 플랫폼 저장하자 PlatformManager.Getsingleton.Save_NowUsePlatformIndex((int)selectedPlatform); //로그인후 구성정보 webRequest.GetReferenceDB(webRequest.newIdxLst(22), callback_Log); callback_Log(); //구성정보후 유저정보 webRequest.GetUserInfos(_user.user_Users.UserID, callback_Log); //클랜정보 불러오기 webRequest.ClanInfo(callback_Log); //친구정보 불러오기 webRequest.FriendList(callback_Log); //서버리스트 불러오기 string CtCode = StaticMethod.Get_OrinCountryCodeString(); webRequest.GetServerList(CtCode, callback_Log); //유저정보후 서버시간 webRequest.GetServerTime(callback_Log); }
/// <summary> /// 卡图由小变大 /// </summary> /// <param name="card"></param> /// <param name="dele"></param> public void ShowAnim(Card card, normalDele dele) { image.rectTransform.localScale = Vector3.one; image.overrideSprite = StaticMethod.GetCardSprite(card.cardID, false); this.gameObject.SetActive(true); Tweener tweener = image.rectTransform.DOScale(Vector3.one * 3, 0.2f); tweener.SetEase(Ease.Linear); tweener.onComplete = delegate() { Tweener tweener1 = image.rectTransform.DOScale(Vector3.one * 3, 0.2f); tweener1.SetEase(Ease.Linear); tweener1.onComplete = delegate() { image.transform.localScale = Vector3.one; this.gameObject.SetActive(false); if (dele != null) { dele(); } }; }; }
private async void NextIconButton_OnClick(object sender, EventArgs e) { if (!String.IsNullOrEmpty(FullNameTextBox.Text) || !String.IsNullOrEmpty(EmailTextBox.Text) || !String.IsNullOrEmpty(AddressTextBox.Text) || !String.IsNullOrEmpty(PhoneNumberTextBox.Text)) { StaticData.CurrentUser.Name = FullNameTextBox.Text; StaticData.CurrentUser.Email = EmailTextBox.Text; StaticData.CurrentUser.Address = AddressTextBox.Text; StaticData.CurrentUser.PhoneNumber = PhoneNumberTextBox.Text; StaticMethod.ShowProgress(this, "Registering...", 0, true, true); string temp = await UserAPI.Register(StaticData.CurrentUser); StaticMethod.ShowProgress(this, "Registering...", 0, true, false); NavigationService.Navigate( new Uri("/PageGroups/LoginGroup/LoginPage.xaml?username="******"&password="******"Please fill in all box", "Warning", MessageBoxButton.OK); } }
//캐릭터 정보 void Set_TapCharacterInfomation() { infos_unit _infoUnit = null; User_Units _userUnit = null; if (user.User_Units.ContainsKey(nowSelectUnitIdx)) { _userUnit = user.User_Units[nowSelectUnitIdx]; } if (TableDataManager.instance.Infos_units.ContainsKey(nowSelectUnitIdx)) { _infoUnit = TableDataManager.instance.Infos_units[nowSelectUnitIdx]; } if (_infoUnit != null) { //스킬이미지 Image_MainSkillTumnail.sprite = ImageManager.instance.Get_Sprite(string.Format("{0}{1}", DefineKey.lobbySkill, (int)_infoUnit.SkillKind)); //이름 Text_UnitName.text = _infoUnit.UnitName; //스킬설명 Text_SkillDescrip.text = TextDataManager.Dic_TranslateText[(int)_infoUnit.UnitIdx]; //레벨 int lv = _userUnit != null ? _userUnit.RefLv : 1; Text_RefLv.text = string.Format("Lv.{0}", lv); float initHp = _infoUnit.Hp; float initMv = _infoUnit.MvSpeed; float initRld = _infoUnit.RldSpeed; int reflv = _userUnit != null ? _userUnit.RefLv : 1; //hp Text_Hp.text = ((int)StaticMethod.Get_nextSpec(initHp, reflv, true)).ToString(); //movespeed Text_MoveSpeed.text = reflv > 4 ? (StaticMethod.Get_nextSpec(initMv, reflv, false, 0.05f, 4)).ToString() //5렙이상시 : initMv.ToString(); // 5렙이하시 기본값 //reloadSpeed Text_ReloadSpeed.text = reflv > 9 ? "+" + Mathf.Abs((int)StaticMethod.Get_nextSpec(initRld, reflv, true, 5f, 9)).ToString() //9렙이상시 : "+" + initRld.ToString(); // 9렙이하시 기본값 //선택 캐릭와 현재배치의캐릭 과 같은지 체크 bool isUseChar = nowSelectUnitIdx == user.User_useUnit.UnitIdxs[(int)user.User_useUnit.nowSelectBatch] ? true : false; //같으면 disable 활성 DisableUseCharObj.SetActive(isUseChar); } }
void Update() { //캐릭터 터치영역 들어왓는지 확인 //Chk_TouchSelectArea(); StaticMethod.Chk_TouchSelectArea(User.isSelectedCharacter, ref TouchType, ref Pos_whenTouchArea, "CharSelectArea"); //캐릭터 선택하기 (회전시키기) CharacterRotating(); }
public IActionResult Method1(Method method) { StaticMethod.Data = method.Data; StaticMethod.Compute(); return(RedirectToAction("Method2")); }
private void OnLoaded(object sender, RoutedEventArgs routedEventArgs) { StaticMethod.GetFavs(); cameraCaptureTask = new CameraCaptureTask(); cameraCaptureTask.Completed += CameraCaptureTaskOnCompleted; photoChooserTask = new PhotoChooserTask(); photoChooserTask.Completed += new EventHandler <PhotoResult>(photoChooserTask_Completed); }
public ActionResult AddMember() { if (StaticMethod.GetType(UserID) != 0) { noAuth = true; } return(View()); }
protected override async void OnNavigatedTo(NavigationEventArgs e) { //if (NetworkInterface.GetIsNetworkAvailable()) if (true) { await LoadData(); } else { IAsyncResult result = Guide.BeginShowMessageBox( AppResources.SplashScreen_OnNavigatedTo_No_Network, AppResources.SplashScreen_OnNavigatedTo_No_network_details, new string[] { "wifi", "3G/4G-LTE" }, 0, MessageBoxIcon.Error, null, null ); result.AsyncWaitHandle.WaitOne(); int?choice = Guide.EndShowMessageBox(result); if (choice.HasValue) { if (choice.Value == 0) { ConnectionSettingsTask con = new ConnectionSettingsTask(); con.ConnectionSettingsType = ConnectionSettingsType.WiFi; con.Show(); } else { ConnectionSettingsTask con = new ConnectionSettingsTask(); con.ConnectionSettingsType = ConnectionSettingsType.Cellular; con.Show(); } } else { MessageBoxResult res = MessageBox.Show(AppResources.SplashScreen_OnNavigatedTo_OfflineModeQuestion, AppResources.SplashScreen_OnNavigatedTo_Offline_Mode, MessageBoxButton.OKCancel); if (res == MessageBoxResult.Cancel) { StaticMethod.Quit(); } else if (res == MessageBoxResult.OK) { StaticData.isOffline = true; //Navigate to MainPage MessageBox.Show("Voucher World required a working internet connection", "We are sorry", MessageBoxButton.OK); StaticMethod.Quit(); //NavigationService.Navigate(new Uri("/PageGroups/KaraokeGroup/OfflinePage.xaml", UriKind.Relative)); } } } base.OnNavigatedTo(e); }
private void btnHexToString_Click(object sender, EventArgs e) { if (rtbInput.Text == string.Empty) { MessageBox.Show("Input!"); return; } rtbOutput.Text = StaticMethod.HexToString(rtbInput.Text); }
public void SutIsMethod() { // Fixture setup Action dummy = delegate { }; // Exercise system var sut = new StaticMethod(dummy.Method); // Verify outcome Assert.IsAssignableFrom<IMethod>(sut); // Teardown }
public void SutIsMethod() { // Arrange Action dummy = () => { }; // Act var sut = new StaticMethod(dummy.GetMethodInfo()); // Assert Assert.IsAssignableFrom <IMethod>(sut); }
/// <summary> /// 특정무기의 현재강화레벨 대한 능력치 반환 /// </summary> public Infos_Weapon Get_ReinfWeapon(uint weaponIdx, byte RefLv) { Infos_Weapon _weapon = new Infos_Weapon(TableDataManager.instance.Infos_weapons[weaponIdx]); _weapon.AtkMin = (int)StaticMethod.Get_nextSpec(_weapon.AtkMin, RefLv, true); _weapon.AtkMax = (int)StaticMethod.Get_nextSpec(_weapon.AtkMax, RefLv, true); _weapon.Critical = (float)StaticMethod.Get_nextSpec(_weapon.Critical, RefLv, false); return(_weapon); }
public void SutIsEquatable() { // Arrange var method = ((Action <object>) delegate { }).GetMethodInfo(); // Act var sut = new StaticMethod(method); // Assert Assert.IsAssignableFrom <IEquatable <StaticMethod> >(sut); }
public void SutIsEquatable() { // Arrange Action <object> action = o => { }; var method = action.GetMethodInfo(); // Act var sut = new StaticMethod(method); // Assert Assert.IsAssignableFrom <IEquatable <StaticMethod> >(sut); }
public void MethodIsCorrect() { // Fixture setup var expectedMethod = ((Action)delegate { }).Method; var sut = new StaticMethod(expectedMethod); // Exercise system var result = sut.Method; // Verify outcome Assert.Equal(expectedMethod, result); // Teardown }
public void ParametersIsCorrectWhenPassedOnOneParamsConstructor() { // Fixture setup Action<object> dummy = delegate { }; var expectedParameters = dummy.Method.GetParameters(); var sut = new StaticMethod(dummy.Method); // Exercise system var result = sut.Parameters; // Verify outcome Assert.True(expectedParameters.SequenceEqual(result)); // Teardown }
public void InvokeWithFactoryMethodReturnsCorrectResult(Type targetType, int index, object values) { // Fixture setup var method = (from mi in targetType .GetMethods(BindingFlags.Static | BindingFlags.Public) where mi.ReturnType == targetType select mi).ElementAt(index); var sut = new StaticMethod(method); // Exercise system var result = sut.Invoke((object[])values); // Verify outcome Assert.IsAssignableFrom(targetType, result); // Teardown }
public void SutDoesNotEqualOtherObjectWithDifferentParameters() { // Fixture setup var method = ((Action<object>)delegate { }).Method; var sut = new StaticMethod(method, method.GetParameters()); var otherParameters = ((Action<int>)delegate { }).Method.GetParameters(); object other = new StaticMethod(method, otherParameters); // Exercise system var result = sut.Equals(other); // Verify outcome Assert.False(result); // Teardown }
public void SutEqualsOtherObjectWithSameMethodAndSameParameters() { var method = ((Action<object>)delegate { }).Method; var parameters = method.GetParameters(); var sut = new StaticMethod(method, parameters); object other = new StaticMethod(method, parameters); // Exercise system var result = sut.Equals(other); // Verify outcome Assert.True(result); // Teardown }
public void SutIsEquatable() { // Fixture setup var method = ((Action<object>)delegate { }).Method; // Exercise system var sut = new StaticMethod(method); // Verify outcome Assert.IsAssignableFrom<IEquatable<StaticMethod>>(sut); // Teardown }
public void SutDoesNotEqualSomeOtherObject() { // Fixture setup var method = ((Action<object>)delegate { }).Method; var sut = new StaticMethod(method); // Exercise system var result = sut.Equals(new object()); // Verify outcome Assert.False(result); // Teardown }
public void GetHashCodeReturnsCorrectResult() { // Fixture setup var method = ((Action<object>)delegate { }).Method; var sut = new StaticMethod(method); // Exercise system var result = sut.GetHashCode(); // Verify outcome var expectedHasCode = method.GetHashCode() ^ method.GetParameters().Aggregate(0, (current, parameter) => current + parameter.GetHashCode()); Assert.Equal(expectedHasCode, result); // Teardown }
public void ParametersIsCorrect() { // Fixture setup Action<int, double> dummy = delegate { }; var expectedParameters = dummy.Method.GetParameters(); var sut = new StaticMethod(dummy.Method, expectedParameters); // Exercise system var result = sut.Parameters; // Verify outcome Assert.True(expectedParameters.SequenceEqual(result)); // Teardown }