/// <summary> /// Transforms into <paramref name="target"/> and sets <see cref="PBEStatus2.Transformed"/>. /// </summary> /// <param name="target">The Pokémon to transform into.</param> /// <remarks>Frees the Pokémon of its <see cref="ChoiceLockedMove"/>.</remarks> public void Transform(PBEPokemon target) { if (Team != target.Team) { KnownAbility = target.KnownAbility = Ability = target.Ability; KnownType1 = target.KnownType1 = Type1 = target.Type1; KnownType2 = target.KnownType2 = Type2 = target.Type2; KnownWeight = target.KnownWeight = Weight = target.Weight; } else { Ability = target.Ability; KnownAbility = target.KnownAbility; Type1 = target.Type1; KnownType1 = target.KnownType1; Type2 = target.Type2; KnownType2 = target.KnownType2; Weight = target.Weight; KnownWeight = target.KnownWeight; } KnownGender = target.KnownGender = target.Gender; KnownShiny = target.KnownShiny = target.Shiny; KnownSpecies = target.KnownSpecies = Species = target.Species; Attack = target.Attack; Defense = target.Defense; SpAttack = target.SpAttack; SpDefense = target.SpDefense; Speed = target.Speed; AttackChange = target.AttackChange; DefenseChange = target.DefenseChange; SpAttackChange = target.SpAttackChange; SpDefenseChange = target.SpDefenseChange; SpeedChange = target.SpeedChange; AccuracyChange = target.AccuracyChange; EvasionChange = target.EvasionChange; PreTransformMoves = (PBEMove[])Moves.Clone(); PreTransformPP = (byte[])PP.Clone(); PreTransformMaxPP = (byte[])MaxPP.Clone(); for (int i = 0; i < Team.Battle.Settings.NumMoves; i++) { if (Team != target.Team) { KnownMoves[i] = target.KnownMoves[i] = Moves[i] = target.Moves[i]; } else { Moves[i] = target.Moves[i]; KnownMoves[i] = target.KnownMoves[i]; } if (Id != byte.MaxValue) // Don't set PP if this is a client's unknown remote Pokémon { PP[i] = MaxPP[i] = (byte)(Moves[i] == PBEMove.None ? 0 : PBEMoveData.Data[Moves[i]].PPTier == 0 ? 1 : Team.Battle.Settings.PPMultiplier); } } if (!Moves.Contains(ChoiceLockedMove)) { ChoiceLockedMove = PBEMove.None; } Status2 |= PBEStatus2.Transformed; }
public static void RestoreEnergyByIdle() { PlayerSave.ActiveSave.energy.Value += (int)((DateTime.Now - PP.GetDateTime(PPKeys.LAST_ENERGY_RELOADING_TIME)).TotalSeconds / ENERGY_RELOADING_TIME); PlayerSave.Save(); PP.SetDateTime(PPKeys.LAST_ENERGY_RELOADING_TIME, DateTime.Now); }
public JsonResult NewTopicPeople() { UserAuth(); var topicid = Request.Form["topicid"]; var pps = Request.Form["pps"]; var splitstrs = pps.Split(new string[] { " @" }, StringSplitOptions.RemoveEmptyEntries); var pplist = new List <string>(); foreach (var PP in splitstrs) { if (PP.Trim().ToUpper().Contains(ViewBag.username.ToUpper())) { continue; } pplist.Add(PP.Replace("@", "").Trim()); } CoTopicVM.UpdateTopicPeople(topicid, pplist, this); var ret = new JsonResult(); ret.Data = new { sucess = true }; return(ret); }
/// <inheritdoc/> public void WriteDataToStream(BinaryWriter writer) { EarthboundPlainTextEncoding PlainTextEncoding = new EarthboundPlainTextEncoding(); writer.Write(PlainTextEncoding.GetBytesPadded(Name, 5)); writer.Write(Level); writer.Write(Experience); writer.Write(HP.MaxValue); writer.Write(PP.MaxValue); writer.Write((byte)PermanentStatusEffect); writer.Write((byte)PossessionStatus); writer.Write((byte)BattleStatusEffect); writer.Write(FeelingStrange); writer.Write(CantConcentrateTurns); writer.Write(Homesick); //TODO: Shield Offense.WriteDataToStream(writer); Defense.WriteDataToStream(writer); Speed.WriteDataToStream(writer); Guts.WriteDataToStream(writer); Luck.WriteDataToStream(writer); Vitality.WriteDataToStream(writer); IQ.WriteDataToStream(writer); Inventory.WriteDataToStream(writer); HP.WriteDataToStream(writer); PP.WriteDataToStream(writer); throw new NotImplementedException("Weaknesses, miss rates, permanent boosts, shields, etc"); }
public static bool CanCopyTo(PP dpp) { // dPP nin HH leri olmamali (Sadece PP ye bagli AnaHesap disinda); var hhCount = Db.SQL <HH>("select r from HH r where r.PP = ?", dpp).Count(); return(hhCount == 1); }
//工作 private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { PP m = e.Argument as PP; if (m != null) { ParamInfo PI = m.ll[0]; ParamObject PM = new ParamObject(); PM.ServerIP = PI.IP; PM.ServerPort = int.Parse(PI.Port); PM.Office = PI.Office; PnrAnalysis.FormatPNR format = new FormatPNR(); int i = 1; foreach (string item in m.ticketList) { if (item.Replace("-", "").Trim() != "") { //发送指令 PM.code = "detr:TN" + item.Replace("-", "").Trim(); string RecvData = SendNewPID.SendCommand(PM); string TicketStatus = format.GetTicketStatus(RecvData); if (TicketStatus.ToUpper().Contains("OPEN FOR USE")) { m.resultList.Add(item); LogWrite(item + "\r\n", path); } backgroundWorker1.ReportProgress((i * 100) / m.ticketList.Count, "发送:" + PM.code + "结果:" + RecvData); Thread.Sleep(m.ScanJJ * 1000); } i++; } e.Result = m; } }
public void can_get_all_tokens_from_a_string() { var pp = new PP(); pp.Tokens("Hi $foo$ pers$on$").ShouldEqual(new List <string> { "foo", "on" }); pp.Tokens("Hi $foo$pers$on$").ShouldEqual(new List <string> { "foo", "on" }); pp.Tokens("Hi $foo$pers$on $").ShouldEqual(new List <string> { "foo" }); pp.Tokens("$Hi $foo$pers$on $").ShouldEqual(new List <string> { "foo" }); pp.Tokens("$Hi$foo$pers$on $").ShouldEqual(new List <string> { "Hi", "pers" }); pp.Tokens("$Hi$$foo$$pers$on$").ShouldEqual(new List <string> { "Hi", "foo", "pers" }); pp.Tokens("$Hi$$foo$$pers$$on$").ShouldEqual(new List <string> { "Hi", "foo", "pers", "on" }); }
public ActionResult Orden(int id, int ncontador) { //Producto producto = db.Productoes.Find(id); if (ncontador == 0) { creacionPedido(); ncontador++; } PP aux = new PP(); aux.IdProducto = id; aux.IdPedido = (from c in db.PS select c).Count(); if (ModelState.IsValid) { db.PPS.Add(aux); db.SaveChanges(); } //Productos var lista_de_productos = from c in db.Productoes select c; ViewBag.Productos = lista_de_productos.ToList(); ViewBag.Contador = ncontador; return(View(db.PPS.ToList())); }
public static void CopyFromPP(PP spp, PP dpp) { if (!CanCopyTo(dpp)) { return; } HH[] dhh = new HH[9]; dhh[0] = dpp.HHroot; int not = 0; List <HH> list = new List <HH>(); ChildreenOfNode(spp.HHroot, 0, list); Db.Transact(() => { foreach (var hh in list) { not = hh.Lvl - 1; // 2den baslar. 1den baslasin 0:dpp.HHroot dhh[not] = new HH { PP = dpp, Prn = dhh[not - 1], Ad = hh.Ad, }; } }); }
public static TutorialPart GetNextTutorialPart() { #if UNITY_EDITOR && BUILD_TYPE_DEBUG if (DebugOption.Instance.tutorialDO.forceTutorialPart != TutorialPart.NONE) { TutorialPart forceP = DebugOption.Instance.tutorialDO.forceTutorialPart; // DebugOption.Instance.tutorialDO.forceTutorialPart = TutorialPart.NONE; Debug.Log("CALL GetNextTutorialPart force:" + forceP); return(forceP); } #endif foreach (TutorialPart part in Enum.GetValues(typeof(TutorialPart))) { if (part == TutorialPart.NONE) { continue; } #if BUILD_TYPE_DEBUG Debug.Log("CALL GetNextTutorialPart :" + part); #endif if (!PP.GetPartState(part).IsSkipOrDone()) { #if BUILD_TYPE_DEBUG Debug.Log("CALL GetNextTutorialPart go:" + part); #endif return(part); } } #if BUILD_TYPE_DEBUG Debug.Log("CALL GetNextTutorialPart NONE"); #endif return(TutorialPart.NONE); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { // AspNetLib による設定を追加 AspNetLib.ConfigureServices(StartupHelper, services); // 基本的な設定を追加 StartupHelper.ConfigureServices(services); // リクエスト数制限機能を追加 services.AddHttpRequestRateLimiter <HttpRequestRateLimiterHashKeys.SrcIPAddress>(_ => { }); //// Cookie 認証機能を追加 EasyCookieAuth.LoginFormMessage.TrySet("ログインが必要です。"); EasyCookieAuth.AuthenticationPasswordValidator = StartupHelper.SimpleBasicAuthenticationPasswordValidator; EasyCookieAuth.ConfigureServices(services, !StartupHelper.ServerOptions.AutomaticRedirectToHttpsIfPossible); // LogBrowesr 機能を設定 AspNetLib.SetupLogBrowser(services, new LogBrowserOptions(PP.Combine(Env.AppRootDir, "Log"), "DaemonCenter Server 本体ログブラウザ")); // MVC 機能を追加 services.AddControllersWithViews() .ConfigureMvcWithAspNetLib(AspNetLib); this.DaemonCenterServer = new Server(); // シングルトンサービスの注入 services.AddSingleton(this.DaemonCenterServer); // Daemon Center RPC 独立ポートサーバーの作成 this.DaemonCenterRpcHost = new DaemonCenterServerRpcHttpHost(this.DaemonCenterServer); // 全ページ共通コンテキストの注入 services.AddScoped <PageContext>(); }
public void ConfigureDestinations() { T1.ConfigureDestination(T2, null); T2.ConfigureDestination(T3, T1); T3.ConfigureDestination(PP, T2); PP.ConfigureDestination(PD, T3); PD.ConfigureDestination(null, T3); }
public ActionResult DeleteConfirmed(int id) { PP pP = db.PPS.Find(id); db.PPS.Remove(pP); db.SaveChanges(); return(RedirectToAction("Index")); }
public void LoadParticipantData(byte[] bytes) { PP.LoadBytes(bytes); for (int i = 0; i < 22; i++) { PlayerResults[i].Name = PP.FieldParticipantData[i].Name.Replace("\0", ""); } }
public void Skip() { PP.SetPartState(TutorialPart.BATTLE, TutorialPartState.SKIP); PP.SetPartState(TutorialPart.BUILDUP, TutorialPartState.SKIP); PP.SetPartState(TutorialPart.EDIT, TutorialPartState.SKIP); PP.Save(); TutorialFSM.Instance.SendFsmNextEvent(); }
/// <summary> /// Returns Playerpref data. /// </summary> /// <param name="pref"></param> /// <returns></returns> public dynamic GetData(PP pref) { if (serializableDictPrefs.ContainsKey(pref)) { return(((SerializableDictPP)data.d[pref]).GetAverage()); } return(Convert.ChangeType(data.d[pref], data.d[pref].GetType())); }
void PP_ExitWithSave(object sender, EventArgs e) { using (MemoryStream ms = new MemoryStream()) { PP.SaveImage(ms); _imageContent = Convert.ToBase64String(ms.ToArray()); this.DialogResult = System.Windows.Forms.DialogResult.OK; } }
public override void Awake() { base.Awake(); mainui = GameObject.Find("UIMainpage").GetComponent <mainUISet>(); getSmssBtn.onClick.AddListener((() => { FreezeButton(getSmssBtn); HttpManager.Instance.GetSMSS(PublicAttribute.UserInfo.PhoneNo, (b => { Debug.Log("获取短信验证码 " + b); })); })); backBtn.onClick.AddListener(() => { LoginUIController.Instance.SetNextUIState(LoginUIState.LoginPanel); }); sureBtn.onClick.AddListener(() => { if (newpwRepeatInput.text != newpwInput.text) { PP.ShowPopup("", GlobalParameter.InputRepeatWrong); return; } if (string.IsNullOrEmpty(newpwInput.text) || newpwInput.text.Length < 6) { PP.ShowPopup("", GlobalParameter.InputPassword); return; } if (string.IsNullOrEmpty(newpwRepeatInput.text) || newpwRepeatInput.text.Length < 6) { PP.ShowPopup("", GlobalParameter.InputRepeatPassword); return; } if (string.IsNullOrEmpty(smssInput.text) || smssInput.text.Length != 6) { PP.ShowPopup("", GlobalParameter.InputSMSS); return; } Debug.Log("b"); if (VerifyPwd(newpwInput.text) && VerifyPwd(newpwRepeatInput.text) && newpwInput.text == newpwRepeatInput.text && VerifySMSCode(smssInput.text)) { if (!isHit) { isHit = true; HttpManager.Instance.ResetPwd(PublicAttribute.UserInfo.PhoneNo, newpwRepeatInput.text, smssInput.text, (PopupInfo)); } } }); this.gameObject.SetActive(false); }
public void Reload() { PlayerSave.ActiveSave.energy.Value++; PlayerSave.Save(); EnergyReloader.onEnergyReload.Invoke(); PP.SetDateTime(PPKeys.LAST_ENERGY_RELOADING_TIME, DateTime.Now); StartCoroutine(Reloader()); }
public DialogResult LoadImages(string content) { if (PP == null) { CreateValueControl(); } MemoryStream ms = new MemoryStream(Convert.FromBase64String(content)); PP.LoadImage(ms); return(this.ShowDialog()); }
//Static Member Function /// <summary> /// Find meta pref of a pref. /// </summary> /// <param name="pref"></param> /// <returns></returns> public static PP FindSerializablePP(PP pref) { foreach (KeyValuePair <PP, List <PP> > pair in serializableDictPrefs) { if (pair.Value.Contains(pref)) { return(pair.Key); } } throw new NullReferenceException("There is no such value named as " + pref.ToString() + " in serializableDictPrefs dictionary."); }
/* * * * STRONA PIONOWEGO * * */ public IActionResult Pionowy() { ViewData["Message"] = "Obliczenia długosci sond (pionowych) gruntowych dla pomp ciepła o mocy <=30kW"; var model = new PP(); model.BOX1 = "style1"; model.BOX2 = "style1"; model.BOX3 = "style1"; model.BOX4 = "style1"; return(View(model)); }
void OnExitBuildUp() { SendStep( 410, () => { PP.SetPartState(TutorialPart.BUILDUP, TutorialPartState.DONE); PP.Save(); TutorialFSM.Instance.SendFsmNextEvent(); }); }
public ActionResult Edit([Bind(Include = "ID,IdProducto,IdPedido,Observacion")] PP pP) { if (ModelState.IsValid) { db.Entry(pP).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IdProducto = new SelectList(db.Productoes, "ID", "Nombre", pP.IdProducto); return(View(pP)); }
public float GetDictData(PP p) { foreach (KeyValuePair <PP, List <PP> > prefPair in serializableDictPrefs) { if (prefPair.Value.Contains(p)) { return(((SerializableDictPP)data.d[prefPair.Key]).d[p]); } } throw new ArgumentNullException(); }
internal ActionHandler GetStandAloneActionHandler(string pluginID, string ID) { foreach (PluginPackage PP in mPluginPackages) { ActionHandler AH = PP.GetStandAloneActionHandler(ID); if (AH != null) { return(AH); } } throw new Exception("Action handler not found for Action ID: " + ID); }
public ActionResult Create([Bind(Include = "ID,IdProducto,IdPedido,Observacion")] PP pP) { if (ModelState.IsValid) { db.PPS.Add(pP); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IdProducto = new SelectList(db.Productoes, "ID", "Nombre", pP.IdProducto); return(View(pP)); }
static void Main() { Hlp.Indexes(); IHandler[] handlers = new IHandler[] { new MainHandlers(), new PartialHandlers() //new HookHandlers() }; foreach (IHandler handler in handlers) { handler.Register(); } if (Db.SQL <CC>("select r from CC r where r.Email = ?", "test").FirstOrDefault() == null) { var ccNew = CC.InsertRec("test", "test", "test", true); Db.Transact(() => { new CU { CC = ccNew, Email = $"{ccNew.Email}/1", Token = $"{ccNew.Email}/1", Ad = "Test1", Pwd = "test/1" }; }); } string email = "*****@*****.**"; if (Db.SQL <CC>("select r from CC r where r.Email = ?", email).FirstOrDefault() == null) { string pwd = "adlc"; string token = Hlp.EncodeQueryString($"{email}/{pwd}"); CC ccNew = CC.InsertRec(email, pwd, token, true); PP ppNew = PP.InsertRec((long)ccNew.GetObjectNo(), "TurgutreisMarina", null, null); Hlp.SablondanEkle(ppNew.GetObjectNo(), "HHSablonTenis"); } email = "*****@*****.**"; if (Db.SQL <CC>("select r from CC r where r.Email = ?", email).FirstOrDefault() == null) { string pwd = "sdgm"; string token = Hlp.EncodeQueryString($"{email}/{pwd}"); CC ccNew = CC.InsertRec(email, pwd, token, true); } }
public static void T() { PP p = new PP() { Name = "Mike" }; MM m = new MM() { Name = "Steve" }; Test(p, m); }
public static PassivePlugin Get(string Name) { foreach (PassivePlugin PP in Collection) { if (PP.Name.Equals(Name)) { PassivePlugin NewInstance = PP.GetInstance(); NewInstance.FileName = PP.FileName; return(NewInstance); } } return(null); }