public void Set(GameTime time, Note note) { HitGrade grade = HitGrade.Bad; if (note.Motion == Motion.NotSet) { if (Math.Abs(note.HitResult.Difference) <= NoteTiming.Perfect) { grade = HitGrade.Perfect; } else if (Math.Abs(note.HitResult.Difference) <= NoteTiming.Great) { grade = HitGrade.Great; } else if (Math.Abs(note.HitResult.Difference) <= NoteTiming.Good) { grade = HitGrade.Good; } } else { grade = HitGrade.Perfect; // Successful motion hits are always Perfects } for (int i = 0; i < MaxGrades; i++) { if (!Grades[i].IsVisible) { Grades[i].Set(time, grade, note.LaneIndex, note.Width); break; } } }
public override int GetHashCode() { int hash = 1; if (Status.Length != 0) { hash ^= Status.GetHashCode(); } if (encounterPokemonTelemetry_ != null) { hash ^= EncounterPokemonTelemetry.GetHashCode(); } if (Balltype != 0) { hash ^= Balltype.GetHashCode(); } if (HitGrade != 0) { hash ^= HitGrade.GetHashCode(); } if (CurveBall != false) { hash ^= CurveBall.GetHashCode(); } if (MissPercent != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(MissPercent); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public void Set(GameTime time, HitGrade grade, int laneIndex, int width) { StartTime = time.TotalGameTime.TotalMilliseconds; IsVisible = true; switch (grade) { case HitGrade.Bad: Texture = Globals.Textures["BadGrade"]; break; case HitGrade.Good: Texture = Globals.Textures["GoodGrade"]; break; case HitGrade.Great: Texture = Globals.Textures["GreatGrade"]; break; case HitGrade.Perfect: Texture = Globals.Textures["PerfectGrade"]; break; default: break; } // Somehow convert Note into drawRectangle if (drawRectangle == null) { drawRectangle = new Rectangle(); } // 250 is far left, 930 is far right float spacing = 45.3f; // 42.5? what should this be drawRectangle.X = (int)(250 + laneIndex * spacing + spacing * (width - 1) / 2); // TODO this needs to get fixed drawRectangle.Y = 500; drawRectangle.Width = 100; drawRectangle.Height = 20; }