//キー入力 public bool hit(KeyCode aKey, float aSecond, Note.HitNoteType aType) { int tLength = (mTriplet) ? 3 : 4; for (int i = 0; i < tLength; i++) { if (mNotes[i] == null) { continue; //音符なし } float tSecond = MusicScoreData.quarterBeatToMusicTime(mNotes[i].mCorrectQuarterBeat); TypeEvaluation.Evaluation tEvaluation = TypeEvaluation.evaluate(aSecond, tSecond); if (tEvaluation == TypeEvaluation.Evaluation.miss) { continue; //タイミングがあってない } //タイミングOK Note.HitResult tHitResult = mNotes[i].hit(aKey, aType); if (tHitResult == Note.HitResult.miss) { continue; //hitしなかった } //hitしたメッセージ送信 Subject.sendMessage(new Message("hittedNote", new Arg(new Dictionary <string, object>() { { "note", mNotes[i] }, { "evaluation", tEvaluation }, { "difference", aSecond - tSecond }, { "hitResult", tHitResult } }))); return(true); } return(false); }
public async Task <TypeEvaluation> CreateTypeEvaluation(TypeEvaluation newTypeEvaluation) { await _unitOfWork.TypesEvaluation .AddAsync(newTypeEvaluation); await _unitOfWork.CommitAsync(); return(newTypeEvaluation); }
public ActionResult Create(TypeEvaluation NouvTypeEvaluation) { try { DB.TypeEvaluations.Add(NouvTypeEvaluation); DB.SaveChanges(); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Create(TypeEvaluation NouvTypeEvaluation) { try { DB.TypeEvaluations.Add(NouvTypeEvaluation); DB.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int id, TypeEvaluation EditTypeEvaluation) { try { var typeEvaluation = (from t in DB.TypeEvaluations where t.TypeEvaluationId == id select t).First(); typeEvaluation.Type = EditTypeEvaluation.Type; typeEvaluation.Ponderation = EditTypeEvaluation.Ponderation; DB.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int id, TypeEvaluation EditTypeEvaluation) { try { var typeEvaluation = (from t in DB.TypeEvaluations where t.TypeEvaluationId == id select t).First(); typeEvaluation.Type = EditTypeEvaluation.Type; typeEvaluation.Ponderation = EditTypeEvaluation.Ponderation; DB.SaveChanges(); return RedirectToAction("Index"); } catch { return View(); } }
public async Task UpdateTypeEvaluation(TypeEvaluation typeEvaluationToUpdate, TypeEvaluation typeEvaluation) { typeEvaluationToUpdate.Type = typeEvaluation.Type; await _unitOfWork.CommitAsync(); }
public async Task DeleteTypeEvaluation(TypeEvaluation typeEvaluation) { _unitOfWork.TypesEvaluation.Remove(typeEvaluation); await _unitOfWork.CommitAsync(); }