public virtual void Show(JudgeType type) { switch (type) { case JudgeType.Miss: text.text = "MISS"; break; case JudgeType.Bad: text.text = "BAD"; break; case JudgeType.Nice: text.text = "NICE"; break; case JudgeType.Great: text.text = "GREAT"; break; case JudgeType.Perfect: text.text = "PERFECT"; break; case JudgeType.Fantastic: text.text = "FANTASTIC"; break; } text.gameObject.SetActive(true); isAnimating = true; t = 0; }
public void Initialize(JudgeType judgeType, float maxWaitingTime = 2.0f) { this.judgeType = judgeType; this.maxWaitingTime = maxWaitingTime; this.isInitialized = true; }
public void ShowJudge(JudgeType type) { int typeConverted = (int)type; if (type != JudgeType.Poor) { typeConverted = (typeConverted + 1) / 2; } GameObject judgeOBJ = judgeObj; judgeOBJ.transform.position = new Vector3(-1.59f, -0.79f); judgeOBJ.transform.localScale = new Vector3(1.595f, 1.595f, 1.595f); if (judgeOBJ.GetComponent <SpriteRenderer>() == null) { judgeOBJ.AddComponent <SpriteRenderer>(); } SpriteRenderer sr = judgeOBJ.GetComponent <SpriteRenderer>(); sr.enabled = true; if (typeConverted == -1) { sr.sprite = judgeTypeSprite[4]; judgeOBJ.transform.position = new Vector3(0f, judgeOBJ.transform.position.y); } else if (typeConverted == 3) { sr.sprite = judgeTypeSprite[typeConverted]; judgeOBJ.transform.position = new Vector3(0f, judgeOBJ.transform.position.y); } else { sr.sprite = judgeTypeSprite[typeConverted]; } sr.sortingOrder = 7; }
private void ShowJudge(JudgeType type) { judgePanel.GetComponentInChildren <Image>().sprite = judgeTextSpriteArr[(int)type]; judgePanel.transform.localScale = Vector2.zero; judgePanel.transform.DOScale(Vector2.one, 0.1f).SetEase(Ease.OutQuint); judgePanel.SetActive(true); }
private void playJudgeText(JudgeType judgeType, NoteSoundType soundType) { this.noteJudgeTexts[(int)soundType].gameObject.SetActive(true); this.noteJudgeTexts[(int)soundType].text = judgeType.ToString(); this.noteJudgeTextTimers[(int)soundType] = 1.0f; switch (judgeType) { case JudgeType.PERFECT: this.noteJudgeTexts[(int)soundType].color = Color.yellow; break; case JudgeType.GREAT: this.noteJudgeTexts[(int)soundType].color = Color.green; break; case JudgeType.GOOD: this.noteJudgeTexts[(int)soundType].color = Color.blue; break; case JudgeType.SAFE: this.noteJudgeTexts[(int)soundType].color = Color.magenta; break; } }
public void Set(NoteData d, int ls = 0) { data = d; previousNotes = new List <Note>(); previousTails = new List <Tail>(); previousConnectors = new List <Connector>(); appearTime = ReachTime - (1f / (Speed * Game.NoteSpeed)); for (int i = 0; i < data.prevIds.Count; i++) { if (data.prevIds[i] > 0 && Type != NoteType.SlideDummy) { previousNotes.Add(Game.notes[data.prevIds[i]]); Game.notes[data.prevIds[i]].nextNote = this; } } slideGroupFinger = 100; lineSet = ls; hitTime = ReachTime; latestSlideJudge = JudgeType.NotJudged; startPos = Game.Mode.GetStartPos(lineSet, StartLine); endPos = Game.Mode.GetEndPos(lineSet, EndLine); }
public override void CreateFX(JudgeType returnType) { if ((int)returnType < 3) { GameObject judgeFX = Instantiate(effect) as GameObject; judgeFX.transform.position = new Vector3(transform.position.x + 0.4f, -3.44f); } }
public ActionResult DeleteConfirmed(int id) { JudgeType judgeType = db.JudgeTypes.Find(id); db.JudgeTypes.Remove(judgeType); db.SaveChanges(); return(RedirectToAction("Index")); }
void Start() { for (JudgeType i = JudgeType.PERFECT; i != JudgeType.IGNORE; ++i) { numberlingElements[(int)i].RollingNumber(SingletonData.Instance.resultData.judgeCount[i]); } numberlingElements[4].RollingNumber(SingletonData.Instance.resultData.maxCombo); }
public JudgeType NormalNoteJudge(int differenceFrame, int judgeLane, JudgeData judgeData) { JudgeType judgeResult = JudgeType.None; JudgeStruct[] judges = judgeData.judges; bool isPush = false; // フレームの差が一番長い判定よりも大きくなったらミスにする if (differenceFrame < -judges[judges.Length - 1].flameRange) { particleController.ShowJudgeText(judgeLineTrans[judgeLane], judgeData.judges[(int)JudgeType.Miss].sprite); SetNextNote(judgeLane); judgeResult = JudgeType.Miss; } if (StaticValue.isAuto) { isPush = differenceFrame <= 0 ? true : false; } else { isPush = ButtonDownInput(judgeLane); } if (isPush) { for (int i = (int)JudgeType.Just; i < judges.Length; i++) { if (Mathf.Abs(differenceFrame) <= judges[i].flameRange) { //輝くノーツの場合は必ず最高判定にする if (nextNotes[judgeLane].IsShiny) { i = (int)JudgeType.Just; particleController.PlayParticle(judgeLineTrans[judgeLane], 4); } particleController.ShowJudgeText(judgeLineTrans[judgeLane], judges[i].sprite); particleController.PlayParticle(judgeLineTrans[judgeLane], i); SetLaneBeamColor(judgeLane, beamColor.beamColors[i]); nextNotes[judgeLane].JudgeHide(); PlayTapSE(NotesType.Normal, judgeLane, nextNotes[judgeLane].IsShiny); MightPlayFastLateAnim(differenceFrame, i); SetNextNote(judgeLane); return((JudgeType)Enum.ToObject(typeof(JudgeType), i)); } } SetLaneBeamColor(judgeLane, beamColor.noneColor); } return(judgeResult); }
/// <summary> /// Create all necessary particles from a tap at a given position, of a given judge type and detail, and with a given /// y-offset to account for in spawning the textYOffset. /// </summary> public void TapAt(float2 position, JudgeType judgeType, JudgeDetail judgeDetail, float textYOffset) { if (judgeType != JudgeType.Lost) { TapParticleAt(position); } position.y += textYOffset; TextParticleAt(position, judgeType, judgeDetail); }
// Test public void ProcessNote(HitState hitState, JudgeType type) { if (type == JudgeType.IGNORE) { return; } UIManager.Instance.UpdateRecord(hitState, type); }
public override void CreateFX(JudgeType type) { if ((int)type < 3) { judgeFX = Instantiate(effect) as GameObject; judgeFX.GetComponent <HoldEffect>().duration = note.Dur; judgeFX.transform.position = new Vector3(transform.position.x + 0.4f, -3.44f); } }
private JudgeType[] FillJudgeTypeArray(List <CaseLawUnit> caseLawUnits) { JudgeType[] judges = new JudgeType[caseLawUnits.Count]; for (int i = 0; i < caseLawUnits.Count; i++) { judges[i] = FillJudgeType(caseLawUnits[i]); } return(judges); }
public JudgeScore(int maxCombo, int finalScore) { this.maxCombo = maxCombo; this.finalScore = finalScore; this.judgeCount = new Dictionary <JudgeType, int>(); for (JudgeType i = JudgeType.PERFECT; i != JudgeType.IGNORE; ++i) { judgeCount[i] = 0; } }
public ActionResult Edit(JudgeType judgeType) { if (ModelState.IsValid) { db.Entry(judgeType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(judgeType)); }
/// <summary>ノーツ処理時に必ず呼び出す</summary> /// <param name="judge">処理時の判定</param> public void Process(JudgeType judge) { // 二重処理防止 if (IsProcessed) { return; } IsProcessed = true; }
// // GET: /JudgeType/Delete/5 public ActionResult Delete(int id = 0) { JudgeType judgeType = db.JudgeTypes.Find(id); if (judgeType == null) { return(HttpNotFound()); } return(View(judgeType)); }
public void AddJudge(JudgeType jtype, int count = 1) { switch (jtype) { case JudgeType.MaxPure: maxPureCount += count; IncMpureChain(count); break; case JudgeType.EarlyPure: earlyPureCount += count; mpureChain = 0; IncPureChain(count); break; case JudgeType.LatePure: latePureCount += count; mpureChain = 0; IncPureChain(count); break; case JudgeType.EarlyFar: earlyFarCount += count; mpureChain = 0; pureChain = 0; IncCombo(count); break; case JudgeType.LateFar: lateFarCount += count; mpureChain = 0; pureChain = 0; IncCombo(count); break; case JudgeType.Lost: lostCount += count; mpureChain = 0; pureChain = 0; combo = 0; break; } }
/// <summary> /// Judges the note by given judge result. /// As long as the judge is not silent, this note will be deleted after calling this. /// </summary> /// <param name="judgeType">Judge result.</param> /// <param name="silent">Flag about if this note should be judged without combo reset (and effect).</param> public void Judge(JudgeType judgeType, bool silent = false) { // Avoid duplicated judging if (isHit) { return; } // Cant judge when not judged if (judgeType == JudgeType.NotJudged) { return; } // Here, this note should be 'judged' for some result and processed. isHit = true; // This note is being hit now. Game.noteInput.RemoveNote(EndLine, ID); Game.judge.UpdateJudgeResult(Mathf.RoundToInt(EndLine), judgeType, Flick != FlickType.NotFlick, silent); Game.AddScore(data, judgeType); // Postprocessing depending on the type of note. // If the note is Start note and the result is Miss, if (Type.IsEither(NoteType.HoldStart, NoteType.SlideStart, NoteType.SlideMiddle) && judgeType == JudgeType.Miss) { isDead = true; // This note is dead. if (Type == NoteType.SlideMiddle && Game.Mode.enableStrictSlideJudge) { foreach (var prev in previousNotes) { if (prev.Type == NoteType.SlideStart) { prev.isDead = true; // If slide middle, previous note (that is, start) is also dead. } } } } // If the note is Start note and the result is NOT Miss, if (Type.IsEither(NoteType.HoldStart, NoteType.SlideStart) && judgeType != JudgeType.Miss) { Body.localScale = Game.Mode.GetScale(1); // Fixes the scale as the end scale. // If the note is HoldStart, hides the note instead of deleting. if (Type == NoteType.HoldStart) { HoldHide(); } hitTime = Game.Time; animator.Play("DefaultHoldAnimation"); } else { Delete(); } }
public ActionResult Create(JudgeType judgeType) { if (ModelState.IsValid) { db.JudgeTypes.Add(judgeType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(judgeType)); }
/// <summary> /// 创建JudgeTask实例 /// </summary> /// <param name="submitId">提交ID</param> /// <param name="problemId">问题ID</param> /// <param name="dataVersion">测试数据版本</param> /// <param name="language">语言</param> /// <param name="sourceCode">源代码</param> /// <param name="author">作者</param> /// <param name="timeLimit">时间限制</param> /// <param name="memoryLimit">内存限制</param> /// <param name="judgeAllCases">是否评测全部样例(即使遇到错误答案)</param> /// <param name="judgeType">评测类型</param> /// <returns>JudgeTask实例</returns> public static JudgeContext Create(int submitId, int problemId, string dataVersion, string language, string sourceCode, string author = "", int timeLimit = 1000, int memoryLimit = 262144, bool judgeAllCases = false, JudgeType judgeType = JudgeType.ProgramJudge) { ILangConfig langConfig = ConfigManager.GetLanguageConfig(language); if (langConfig == null) { throw new JudgeException("Unsupported language: " + language); } // 分配评测临时目录 string tempDirectory = RandomString.Next(16); if (langConfig is ProgramLangConfig) { ProgramLangConfig langCfg = langConfig as ProgramLangConfig; tempDirectory = GetTempDirectory(langCfg.JudgeDirectory); UpdatePathInfo(langCfg, tempDirectory); } double timeCompensation = GetTimeCompensation(langConfig); JudgeTask task = new JudgeTask { SubmitId = submitId, ProblemId = problemId, DataVersion = dataVersion, Language = language, SourceCode = sourceCode, Author = author, TimeLimit = (int)(timeLimit / timeCompensation), MemoryLimit = memoryLimit, JudgeAllCases = judgeAllCases, JudgeType = judgeType }; JudgeResult result = new JudgeResult { SubmitId = task.SubmitId, ProblemId = task.ProblemId, Author = task.Author, JudgeDetail = "", MemoryCost = Config.MinimumMemoryCost, TimeCost = 0, PassRate = 0, ResultCode = JudgeResultCode.Accepted }; return(new JudgeContext(task, result, tempDirectory, langConfig)); }
private void UserPlayMode() { bool isFirstNote = false; NoteAsset previous = InputController._instance.GetPreviousNote(note); if (previous == null) { isFirstNote = true; } if (Time.timeSinceLevelLoad <= note.Time + noteDropTime + goodTime) { if (note.CanJudge && ((!previous.CanJudge) || !isFirstNote)) { JudgeType returnType = NoteJudge(note); if (returnType != JudgeType.Poor && returnType != JudgeType.Bad) { isJudged = true; StartCoroutine(DestroyNote()); CreateFX(returnType); InputController.combo++; InputController._instance.ShowJudge(returnType); InputController._instance.ShowCombo(returnType); InputController._instance.ShowFastSlow(returnType); Invoke("HoldEnded", note.Dur); } else if (returnType == JudgeType.Bad && returnType == JudgeType.Poor) { InputController._instance.ShowCombo(returnType); InputController._instance.ShowFastSlow(returnType); } } } else { TransparentHold(); isJudged = true; IsDestroyed = true; InputController.combo = 0; JudgeStatistics.poor += 2; if (JudgeStatistics.life >= 9) { JudgeStatistics.life -= 8f; } InputController._instance.ShowJudge(JudgeType.Poor); InputController._instance.ShowCombo(JudgeType.Poor); InputController._instance.ShowFastSlow(JudgeType.Poor); Debug.Log(note + "poor"); } }
public JudgeType HoldManage(int deltaFlame, bool isPushing, JudgeStruct[] judges) { // -1 判定無し JudgeType judgeType = JudgeType.None; if (judgeCount >= totalJudgeCount) { return(judgeType); } totalFlameCount += deltaFlame; if (isPushing && IsPushed) { pushFlameCount += deltaFlame; } if (totalFlameCount >= Constant.holdJudgeFlame) { judgeType = JudgeType.Miss; // 最初の判定のみ、1フレームでも押されている場合はJustにする if (isFirstjudge) { if (pushFlameCount >= 1) { judgeType = JudgeType.Just; } isFirstjudge = false; } else { for (int i = (int)JudgeType.Just; i < judges.Length; i++) { if (totalFlameCount - pushFlameCount <= judges[i].flameRange) { judgeType = (JudgeType)System.Enum.ToObject(typeof(JudgeType), i); break; } } } judgeCount++; totalFlameCount = Mathf.Clamp(totalFlameCount - Constant.holdJudgeFlame, 0, int.MaxValue); pushFlameCount = Mathf.Clamp(pushFlameCount - Constant.holdJudgeFlame, 0, int.MaxValue); } return(judgeType); }
public void PlayTapParticle(float2 position, JudgeType type, float textYOffset = 0) { ParticlePool.JudgeType jt = (ParticlePool.JudgeType)(-1); switch (type) { case JudgeType.Lost: jt = ParticlePool.JudgeType.Lost; break; case JudgeType.LateFar: case JudgeType.EarlyFar: jt = ParticlePool.JudgeType.Far; break; case JudgeType.EarlyPure: case JudgeType.LatePure: jt = ParticlePool.JudgeType.Pure; break; case JudgeType.MaxPure: jt = ParticlePool.JudgeType.MaxPure; break; } //I WANT TO USE SWITCH EXPRESSIONS BUT F*****G UNITY IS AWFUL AND I WANT TO DIE F**K ParticlePool.JudgeDetail jd = (ParticlePool.JudgeDetail)(-1); switch (type) { case JudgeType.Lost: case JudgeType.MaxPure: jd = ParticlePool.JudgeDetail.None; break; case JudgeType.EarlyFar: case JudgeType.EarlyPure: jd = ParticlePool.JudgeDetail.Early; break; case JudgeType.LateFar: case JudgeType.LatePure: jd = ParticlePool.JudgeDetail.Late; break; } tapQueue.Enqueue(new TapParticleDesc { position = position, type = jt, detail = jd, textYOffset = textYOffset }); }
public void ShowCombo(JudgeType type) { int typeConverted = (int)type; if (type != JudgeType.Poor) { typeConverted = (typeConverted + 1) / 2; } char[] comboChar = Convert.ToString(combo).ToCharArray(); GameObject[] comboList = judgeCombo; if (typeConverted == -1 || typeConverted == 3 || combo == 0) { for (int i = 0; i < 4; i++) { comboList[i].GetComponent <SpriteRenderer>().enabled = false; } } else { if (combo >= 1000) { UpdateNumbers((JudgeType)typeConverted, comboChar); comboList[0].transform.position = new Vector3(0.42f, -0.81f); comboList[1].transform.position = new Vector3(1.13f, -0.81f); comboList[2].transform.position = new Vector3(1.91f, -0.81f); comboList[3].transform.position = new Vector3(2.65f, -0.81f); } else if (combo >= 100) { UpdateNumbers((JudgeType)typeConverted, comboChar); comboList[0].transform.position = new Vector3(0.78f, -0.81f); comboList[1].transform.position = new Vector3(1.56f, -0.81f); comboList[2].transform.position = new Vector3(2.3f, -0.81f); } else if (combo >= 10) { UpdateNumbers((JudgeType)typeConverted, comboChar); comboList[0].transform.position = new Vector3(1.08f, -0.81f); comboList[1].transform.position = new Vector3(1.82f, -0.81f); } else if (combo >= 1) { UpdateNumbers((JudgeType)typeConverted, comboChar); comboList[0].transform.position = new Vector3(1.39f, -0.81f); } } }
public static string Translate(this JudgeType value) { switch (value) { case JudgeType.Full: return("Ordentlicher Richter"); case JudgeType.Reserve: return("Ersatzrichter"); case JudgeType.Chair: return("Vorsitzender Richter"); default: throw new InvalidOperationException(); } }
/// <summary> /// PerfectCnt, GreatCnt, GoodCnt, MissCnt 4개의 파라미터를 설정하고 싶은 갯수만큼 순서대로 설정. /// 설정되지 않은 값은 0으로 초기화. /// </summary> /// <param name="maxCombo"></param> /// <param name="finalScore"></param> /// <param name="judgeValue"></param> public JudgeScore(int maxCombo, int finalScore, params int[] judgeValue) { this.maxCombo = maxCombo; this.finalScore = finalScore; this.judgeCount = new Dictionary <JudgeType, int>(); for (JudgeType i = JudgeType.PERFECT; i != JudgeType.IGNORE; ++i) { if ((int)i <= judgeValue.Length - 1) { judgeCount[i] = judgeValue[(int)i]; } else { judgeCount[i] = 0; } } }
private string FormatJudgeType(JudgeType type) { switch (type) { case JudgeType.Chair: return("VRi"); case JudgeType.Full: return("Ri"); case JudgeType.Reserve: return("ERi"); default: return("X"); } }
public void UpdateRecord(HitState hitState, JudgeType type) { if (hitState.Equals(HitState.HIT)) { combo++; ShowCombo(); } else { if (combo > SingletonData.Instance.resultData.maxCombo) { SingletonData.Instance.resultData.maxCombo = combo; } combo = 0; } ShowJudge(type); }