public async Task <IActionResult> Edit(int id, [Bind("Id,SuspendStart,SuspendEnd,CustomerId")] Suspend suspend) { if (id != suspend.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(suspend); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SuspendExists(suspend.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CustomerId"] = new SelectList(_context.Customer, "Id", "Id", suspend.CustomerId); return(View(suspend)); }
public override void Draw(SpriteBatch sprite_batch, Vector2 draw_offset = default(Vector2)) { Vector2 loc = (draw_offset + this.offset) - (this.loc + this.draw_offset + stereo_offset()); Window.draw(sprite_batch, loc); if (Active) { Chapter.draw(sprite_batch, loc); } else { Short_Chapter.draw(sprite_batch, loc); } if (Save_Id != -1) { Save_Label.draw(sprite_batch, loc); Save.draw(sprite_batch, loc); } if (!New_Game) { if (!Active) { Style.draw(sprite_batch, loc - new Vector2(72, -16)); } else { Mode.draw(sprite_batch, loc); Style.draw(sprite_batch, loc); Map_Save.draw(sprite_batch, loc); Suspend.draw(sprite_batch, loc); } } }
/// <summary> /// 유저가 일정된 시간 동안 탑승을 하지 않았을 경우 진행을 위해서 오브젝트를 강제로 움직인다. /// 주로 호버보드 탑승의 경우에 유저가 타지 못해서 진행이 안 될 경우를 위해서 가동시킨다. /// 먼저 유저가 타서 작동되면 코루틴은 꺼지게 되어있다. /// </summary> /// <param name="time"></param> /// <param name="bothMember"></param> /// <param name="direction"></param> /// <returns></returns> public IEnumerator <CoroutinePhase> Emergency(float time, bool bothMember, Direction direction = null) { yield return(Suspend.Do(time)); if (GameData.Instance.UseNetwork) { if (!bothMember) { direction.SendDirectionHoverActive(); } else { DirectionManager.Instance.ActiveBothMember(); } } else if (!GameData.Instance.UseNetwork) { if (!bothMember) { direction.DirectionActive(); } else { DirectionManager.Instance.ActiveBothMember(); } } }
protected IEnumerator <CoroutinePhase> DirectionRestore(float time, Direction m_direction) { yield return(Suspend.Do(time)); m_direction.Restore(); CoroutineManager.Instance.Unregister(m_coroutine); }
private IEnumerator <CoroutinePhase> ActiveOrder() { DirectionManager.Instance.OpenNarration(4009); m_direction.SetParentInit(); m_ceilingObject.SetActive(true); AssetManager.Effect.Retrieve("DirectionSound_HoverShield", m_ceilingObject.transform); yield return(Suspend.Do(m_activeTime)); AssetManager.Effect.Retrieve("DirectionSound_HoverAccel", transform); GameData.Instance.Map.Move(1); }
//PJY 17.01.17 생성후 1초뒤 UI Open public IEnumerator <CoroutinePhase> Delay() { if (this.GetComponent <Character>() != null && this.GetComponent <Character>().IsAlive()) { hpBar.SetActive(true); } yield return(Suspend.Do(3.0f)); hpBar.SetActive(false); }
public async Task <IActionResult> Create([Bind("Id,SuspendStart,SuspendEnd,CustomerId")] Suspend suspend) { if (ModelState.IsValid) { _context.Add(suspend); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CustomerId"] = new SelectList(_context.Customer, "Id", "Id", suspend.CustomerId); return(View(suspend)); }
private IEnumerator <CoroutinePhase> RockMoveSegTwo() { int rockCount = 0; Quaternion rot = transform.localRotation; yield return(Suspend.Do(5f)); loopSound = AssetManager.Effect.Retrieve("DirectionSound_PortalLoop", transform); pathnum = 11; while (rockCount < 65) { yield return(Suspend.Do(1f)); //pathnum = Random.Range(11, 36); switch (rockCount) { case 2: DirectionManager.Instance.OpenNarration(5002); break; case 3: AssetManager.Effect.Retrieve("Direction_ceiling_sound", GameData.Instance.HoverCraftSegTwo.transform); break; case 4: GameData.Instance.HoverCraftSegTwo.MakeCeiling(); break; } AssetManager.Direction.Retrieve(rock, m_transformPos, rot, m_custompath[pathnum]); ++rockCount; ++pathnum; } ///아래부터 포탈이 닫힐때/// yield return(Suspend.Do(2f)); openPotal.SetActive(false); closePotal.SetActive(true); if (loopSound != null) { loopSound.Restore(); } yield return(Suspend.Do(5f)); Restore(); }
//공격 받았을때 hp가 3초간 보이고 사라집니다. private IEnumerator <CoroutinePhase> BossDelay() { m_bossHpBar[m_bossTargetpart].Visable(); yield return(Suspend.Do(3.0f)); m_bossHpBar[m_bossTargetpart].Invisible(); if (m_bossdelaycorutineCommand != null) { CoroutineManager.Instance.Unregister(m_bossdelaycorutineCommand); m_bossdelaycorutineCommand = null; } }
public void suspend() { //Arrange Suspend suspend = new Suspend() { Student = "*****@*****.**" }; // Act var okResult = _controller.suspend(suspend); // Assert Assert.IsType <NoContentResult>(okResult); }
public void suspendError() { //Arrange Suspend suspend = new Suspend() { Student = "" }; // Act var badResponse = _controller.suspend(suspend); // Assert Assert.IsType <BadRequestObjectResult>(badResponse); }
IEnumerator <CoroutinePhase> Coroutine(float time) { yield return(Suspend.Do(time)); Transform _childTrans = transform.GetComponentInChildren <Animator>().transform; while (true) { Vector3 _pos = _childTrans.position; _pos.y += 0.3f; m_uiweaponPack.PosUpdate(_pos); yield return(null); } }
private IEnumerator <CoroutinePhase> Appear() { m_animator.SetBool("Active", true); m_direction.Finish = false; m_movecoroutine = CoroutineManager.Instance.Register(m_direction.m_custompath[0].PutOnPath(transform, m_direction.m_custompath[0], false)); while (!m_direction.Finish) { yield return(null); } m_direction.Finish = false; m_movecoroutine = CoroutineManager.Instance.Register(m_direction.m_custompath[1].PutOnPath(transform, m_direction.m_custompath[1], false)); for (int i = 0; i < m_turbinePos.Length; ++i) { AssetManager.Effect.Retrieve("FX_BoardLanding", m_turbinePos[i]); } yield return(Suspend.Do(1.0f)); AssetManager.Effect.Retrieve("DirectionSound_Hoverlanding", transform); while (!m_direction.Finish) { yield return(null); } _ride = UIManager.Instance.Open("UIRide", true) as UIRide; Vector3 _vec = transform.position; _vec.y += 1f; _ride.transform.position = _vec; if ("hoverboardSeg2_1" == gameObject.name) { if (UserType.Host == GameData.Instance.UserType) { m_emergency = CoroutineManager.Instance.Register(m_direction.Emergency(m_emergencyTime, true)); } } for (int i = 0; i < m_direction.m_directionCountCheck.Length; ++i) { m_direction.m_directionCountCheck[i].gameObject.SetActive(true); } }
private IEnumerator <CoroutinePhase> DeadTimer() { const float WAITTIME = 3f; yield return(Suspend.Do(WAITTIME)); if (GetComponent <DissolveShader>() != null) { DissolveShader shader = GetComponent <DissolveShader>(); shader.Process(); } yield return(Suspend.Do(WAITTIME)); Character.Restore(); }
private IEnumerator <CoroutinePhase> RockMove() { yield return(Suspend.Do(6f)); AssetManager.Direction.Retrieve("Armageddon", m_transformPos, m_custompath[pathnum]); loopSound = AssetManager.Effect.Retrieve("DirectionSound_PortalLoop", transform); yield return(Suspend.Do(10f)); while (true) { yield return(Suspend.Do(3f)); ++pathnum; AssetManager.Direction.Retrieve(rock, m_transformPos, m_custompath[pathnum]); } }
private static void StateMachine() { Props props = Actor.FromProducer(() => new StateMachineActor()); PID pid = Actor.Spawn(props); // create actor according to the properties definition var a = new StateA(); var b = new StateB(); var c = new StateC(); var suspend = new Suspend(); var resume = new Resume(); pid.Tell(b); // A -> B pid.Tell(suspend); pid.Tell(c); // should be ignored pid.Tell(resume); pid.Tell(c); // B -> C pid.Tell(a); // C -> A pid.Tell(a); // A ignore }
private IEnumerator <CoroutinePhase> ItemSetActive(float time, Action beforeAction = null, Action afterAction = null) { yield return(Suspend.Do(time)); if (null != beforeAction) { beforeAction(); } gameObject.SetActive(true); if (null != afterAction) { afterAction(); } CoroutineManager.Instance.Unregister(m_coroutine); }
private IEnumerator <CoroutinePhase> TimeAttack() { m_move = true; yield return(Suspend.Do(m_attacktime)); attackEmptyNum = UnityEngine.Random.Range(0, Skillset.Count); SkillStartPos = this.transform.position; SkillStartPos.y = 0; SkillStartPos.z = 0; m_weapon[0].position = SkillStartPos; AssetManager.Projectile.Retrieve(Skillset[attackEmptyNum], m_weapon[0], this.gameObject); Skillset.RemoveAt(attackEmptyNum); Attack(); }
protected void btnSuspend_Click(object sender, EventArgs e) { try { Suspend reqSuspend = new Suspend(); reqSuspend.projectName = txtheadProjectName.Text; reqSuspend.Reson = txtSuspendReson.Text; reqSuspend.ExpeseType = ddlExpenseType.SelectedItem.Text; reqSuspend.ExpensesDescription = txtExpesneDescription.Text; reqSuspend.Amount = txtAmount.Text; reqSuspend.Type = "Suspend"; DataContractJsonSerializer objJsonSerSend = new DataContractJsonSerializer(typeof(Suspend)); MemoryStream memStrToSend = new MemoryStream(); objJsonSerSend.WriteObject(memStrToSend, reqSuspend); string data = Encoding.Default.GetString(memStrToSend.ToArray()); //string data = JsonConvert.SerializeObject(employee); WebClient webClient = new WebClient(); webClient.Headers[HttpRequestHeader.ContentType] = "application/json"; var res = webClient.UploadString(URL + "/SuspendProject", "POST", data); MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(res)); DataContractJsonSerializer recv = new DataContractJsonSerializer(typeof(bool)); bool httpResponse = (bool)recv.ReadObject(ms); if (httpResponse) { GetActiveAndSuspendProjectCount(); allClear(); string add = "Project Suspend Successfully ! "; Page.ClientScript.RegisterStartupScript(this.GetType(), "myScript", "Success('" + add + "');", true); } else { string error = "Project Suspend Failed ! "; Page.ClientScript.RegisterStartupScript(this.GetType(), "myScript", "OnError('" + error + "');", true); } } catch (Exception ex) { } }
public static string ResumeProject(string ProjectName) { string response = ""; try { Suspend reqSuspend = new Suspend(); reqSuspend.projectName = ProjectName; reqSuspend.Type = "Resume"; DataContractJsonSerializer objJsonSerSend = new DataContractJsonSerializer(typeof(Suspend)); MemoryStream memStrToSend = new MemoryStream(); objJsonSerSend.WriteObject(memStrToSend, reqSuspend); string data = Encoding.Default.GetString(memStrToSend.ToArray()); //string data = JsonConvert.SerializeObject(employee); WebClient webClient = new WebClient(); webClient.Headers[HttpRequestHeader.ContentType] = "application/json"; var res = webClient.UploadString(URL + "/SuspendProject", "POST", data); MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(res)); DataContractJsonSerializer recv = new DataContractJsonSerializer(typeof(bool)); bool httpResponse = (bool)recv.ReadObject(ms); if (httpResponse) { response = "true"; } else { response = "false"; } } catch (Exception ex) { response = "false"; ex.ToString(); } return(response); }
private IEnumerator <CoroutinePhase> TimeAttack() { m_attackCycle++; yield return(Suspend.Do(skills[0].Cooltime())); if (null != CurrentTarget) { if (!skills[0].IsCooltime()) { if (AILogic.TargetDistance(this.transform, CurrentTarget) <= skills[0].SkillRange) { if (skills[0] != null) { //Debug.Log("공격"); WeaponPosition.transform.forward = (CurrentTarget.position - WeaponPosition.transform.position).normalized; AssetManager.Projectile.Retrieve(skills[0].SkillName, this.WeaponPosition, this.gameObject); skills[0].Reset(this); } } } } if (null != m_customPath) { if (m_attackCycle > m_customPath.m_nodes[m_customIndex].AttackCycle) { Move(); } else { Attack(); } } else { Attack(); } }
public IActionResult suspend(Suspend suspend) { try { if (String.IsNullOrEmpty(suspend.Student)) { processingError = badrequest; throw new ProcessingException(); } //Extract student from request body string students = suspend.Student.ToString(); //add check student if more than 1 and if existing if (!_ihiringRepositorty.suspend(students)) { processingError = notfound; throw new ProcessingException(); } return(NoContent()); } catch (ProcessingException) { // TO-DO: Handle processing exception error error = new error { message = processingError.ToString() }; return(BadRequest(error)); } catch (Exception) { // TO-DO: Handle the non processing related exception return(BadRequest()); } }
protected void OnSuspend(object source, EventArgs e) { Suspend?.Invoke(this, e); }
/// <summary> /// Faults the suspend. /// </summary> /// <param name="obj">The object.</param> private void FaultSuspend(Suspend obj) { SuspendNonRecursive(); SuspendChildren(); }
private IEnumerator <CoroutinePhase> Appear() { m_direction.Finish = false; m_movecoroutine = CoroutineManager.Instance.Register(m_direction.m_custompath[0].PutOnPath(transform, m_direction.m_custompath[0], false)); while (!m_direction.Finish) { yield return(null); } CoroutineManager.Instance.Unregister(m_movecoroutine); m_movecoroutine = null; /////////////////////////////////////위까지 호버 첫번째 패스///////////////////////////////////////////////////////////// for (int i = 0; i < landingEffectPos.Length; ++i) { AssetManager.Effect.Retrieve("FX_BoardLanding", landingEffectPos[i]); //터빈에서 나올 화염이펙트 } switch (hovertype) { case HoverEnum.hoverBoard1: AssetManager.Effect.Retrieve("FX_BoardLandingDust", GameData.Instance.hoverLandingPos[0]); break; case HoverEnum.hoverBoard2: AssetManager.Effect.Retrieve("FX_BoardLandingDust", GameData.Instance.hoverLandingPos[1]); break; } yield return(Suspend.Do(0.5f)); /////////////////////////////////////위까지 하강연출///////////////////////////////////////////////////////////////////////////////////////////// m_direction.Finish = false; m_movecoroutine = CoroutineManager.Instance.Register(m_direction.m_custompath[1].PutOnPath(transform, m_direction.m_custompath[1], false)); yield return(Suspend.Do(4.2f)); AssetManager.Effect.Retrieve("DirectionSound_Hoverlanding", transform); while (!m_direction.Finish) { yield return(null); } CoroutineManager.Instance.Unregister(m_movecoroutine); m_movecoroutine = null; ////////////////////////////////////위까지 마지막 등장path/////////////////////////////////////////////////////////////////////////////////////////////////////////// m_animator.SetBool("Active", false); _ride = UIManager.Instance.Open("UIRide", true) as UIRide; Vector3 _vec = transform.position; _vec.y += 1f; _ride.transform.position = _vec; if (gameObject.name == "hoverboardSeg1_1") { DirectionManager.Instance.OpenNarration(4011); if (UserType.Host == GameData.Instance.UserType) { m_emergency = CoroutineManager.Instance.Register(m_direction.Emergency(m_emergencyTime, true)); } } for (int i = 0; i < m_direction.m_directionCountCheck.Length; ++i) { m_direction.m_directionCountCheck[i].gameObject.SetActive(true); } GetComponent <AudioSource>().volume = 0.0f; }
/// <summary> /// Normally a <pre>video</pre> element doesn't have a <pre>change</pre> event. /// We force one and a use it as a proxy for all the Media Events. /// </summary> /// <param name="args">The event args - Value contains our JSON</param> protected virtual void OnChange(ChangeEventArgs args) { var ThisEvent = args?.Value?.ToString(); VideoEventData videoData = new VideoEventData(); try { videoData = JsonSerializer.Deserialize <VideoEventData>(ThisEvent, serializationOptions); } catch (Exception ex) { LoggerFactory .CreateLogger(nameof(VideoExComponentBase)) .LogError(ex, "Failed to convert the JSON: {0}", ThisEvent); } switch (videoData.EventName) { case VideoEvents.Abort: Abort?.Invoke(videoData.State); AbortEvent.InvokeAsync(videoData.State); break; case VideoEvents.CanPlay: CanPlay?.Invoke(videoData.State); CanPlayEvent.InvokeAsync(videoData.State); break; case VideoEvents.CanPlayThrough: CanPlayThrough?.Invoke(videoData.State); CanPlayThroughEvent.InvokeAsync(videoData.State); break; case VideoEvents.DurationChange: DurationChange?.Invoke(videoData.State); DurationChangeEvent.InvokeAsync(videoData.State); break; case VideoEvents.Emptied: Emptied?.Invoke(videoData.State); EmptiedEvent.InvokeAsync(videoData.State); break; case VideoEvents.Ended: Ended?.Invoke(videoData.State); EndedEvent.InvokeAsync(videoData.State); break; case VideoEvents.Error: Error?.Invoke(videoData.State); ErrorEvent.InvokeAsync(videoData.State); break; case VideoEvents.LoadedData: LoadedData?.Invoke(videoData.State); LoadedDataEvent.InvokeAsync(videoData.State); break; case VideoEvents.LoadedMetadata: LoadedMetadata?.Invoke(videoData.State); LoadedMetadataEvent.InvokeAsync(videoData.State); break; case VideoEvents.LoadStart: LoadStart?.Invoke(videoData.State); LoadStartEvent.InvokeAsync(videoData.State); break; case VideoEvents.Pause: Pause?.Invoke(videoData.State); PauseEvent.InvokeAsync(videoData.State); break; case VideoEvents.Play: Play?.Invoke(videoData.State); PlayEvent.InvokeAsync(videoData.State); break; case VideoEvents.Playing: Playing?.Invoke(videoData.State); PlayingEvent.InvokeAsync(videoData.State); break; case VideoEvents.Progress: Progress?.Invoke(videoData.State); ProgressEvent.InvokeAsync(videoData.State); break; case VideoEvents.RateChange: RateChange?.Invoke(videoData.State); RateChangeEvent.InvokeAsync(videoData.State); break; case VideoEvents.Seeked: Seeking?.Invoke(videoData.State); SeekingEvent.InvokeAsync(videoData.State); break; case VideoEvents.Seeking: Seeking?.Invoke(videoData.State); SeekingEvent.InvokeAsync(videoData.State); break; case VideoEvents.Stalled: Stalled?.Invoke(videoData.State); StalledEvent.InvokeAsync(videoData.State); break; case VideoEvents.Suspend: Suspend?.Invoke(videoData.State); SuspendEvent.InvokeAsync(videoData.State); break; case VideoEvents.TimeUpdate: TimeUpdate?.Invoke(videoData.State); TimeUpdateEvent.InvokeAsync(videoData.State); break; case VideoEvents.VolumeChange: VolumeChange?.Invoke(videoData.State); VolumeChangeEvent.InvokeAsync(videoData.State); break; case VideoEvents.Waiting: Waiting?.Invoke(videoData.State); WaitingEvent.InvokeAsync(videoData.State); break; default: break; } // Here is our catch-all event handler call! EventFired?.Invoke(videoData); }
public void SuspendTest() { Suspend request = new Suspend(); var result = JsonConvert.DeserializeObject <KodiJSON.System.Response.SuspendResponse>(ExecuteTest.GetResponse(request)); }
public void set_data(int save_id) { Save_Id = save_id; // If no save exists if (Save_Id == -1 || Global.save_files_info == null || !Global.save_files_info.ContainsKey(Save_Id)) { if (Window is System_Color_Window) { var window = Window as System_Color_Window; if (Global.save_files_info == null || !Global.save_files_info.ContainsKey(Save_Id)) { window.color_override = Constants.Difficulty.DIFFICULTY_COLOR_REDIRECT[Difficulty_Modes.Normal]; } else { window.color_override = Constants.Difficulty.DIFFICULTY_COLOR_REDIRECT[Global.save_files_info[Save_Id].difficulty]; } } New_Game = true; Chapter.text = Short_Chapter.text = "-----"; Short_Chapter.text = "-----"; } else { New_Game = false; Tactile.IO.Save_Info info = Global.save_files_info[Save_Id]; if (Window is System_Color_Window) { (Window as System_Color_Window).color_override = Constants.Difficulty.DIFFICULTY_COLOR_REDIRECT[info.difficulty]; } if (string.IsNullOrEmpty(info.chapter_id)) { Chapter.text = Short_Chapter.text = "New Game"; } else { string actual_chapter_id = !Global.data_chapters.ContainsKey(info.chapter_id) ? info.chapter_id.Substring(0, info.chapter_id.Length - 1) : info.chapter_id; if (Global.data_chapters.ContainsKey(info.chapter_id)) { Chapter.text = Global.data_chapters[info.chapter_id].FileSelectName; Short_Chapter.text = Global.data_chapters[info.chapter_id].ShortName; } else { Chapter.text = info.chapter_id; Short_Chapter.text = info.chapter_id; } } Mode.text = info.difficulty.ToString(); Style.text = info.style.ToString(); Map_Save.SetColor(Global.Content, info.map_save_exists ? "White" : "Grey"); Suspend.SetColor(Global.Content, info.suspend_exists ? "White" : "Grey"); } if (Save_Id != -1) { Save.text = Save_Id.ToString(); } }
public void Can_serialize_Suspend() { var message = new Suspend(); AssertAndReturn(message).Should().BeOfType <Suspend>(); }
//공격 할 수 있는 타겟이 순차적으로 깜박입니다. 타겟이 공격받을 경우에만 데미지가 들어옵니다. private IEnumerator <CoroutinePhase> BosstargetFlicker() { float time = 0.0f; while (m_first) { if (istarget) { if (isactiveskill) { Character.AnimatorAction.Initialize <AnimatorActionBossAdd>(); isactiveskill = false; } m_first = false; break; } yield return(Suspend.OneFrame()); } while (true) { time += Time.deltaTime; m_bossTarget.VisibleObj(m_bossTargetpart); m_bossTarget.InVisibleColider(m_bossTargetpart); m_bossTarget.VisibleMesh(m_bossTargetpart); yield return(Suspend.Do(0.2f)); if (-1 == m_bossTargetpart || m_bossHpBar[m_bossTargetpart].Close()) { time = 0.0f; break; } m_bossTarget.InVisibleMesh(m_bossTargetpart); yield return(Suspend.Do(0.2f)); if (-1 == m_bossTargetpart || m_bossHpBar[m_bossTargetpart].Close()) { time = 0.0f; break; } if (time > m_flicktime) { m_bossTarget.InVisibleObj(m_bossTargetpart); m_bossHpBar[m_bossTargetpart].Invisible(); m_bossTarget.VisibleColider(m_bossTargetpart); time = 0.0f; m_bossTargetpart = HpCheck(m_bossTargetpart); if (-1 == m_bossTargetpart) { break; } } yield return(Suspend.OneFrame()); } }