public static void AddNote(Direction direction, NoteType noteType) { var adjustment = TimePassed % SnappingScale; var exactTime = TimePassed - adjustment; Song.SongNotes.Add(new SongNote { Beat = exactTime, Direction = direction, NoteType = noteType}); }
public Note(NoteType type, string captionId, string textId, bool active) { this.type = type; this.captionId = captionId; this.textId = textId; this.active = active; }
public static AccuracyType GetAccuracyValue(float timeDiff, NoteType type) { float timeDiffAbs = (timeDiff > 0) ? (timeDiff) : (-timeDiff); switch (type) { case NoteType.TAP: case NoteType.HOLD: case NoteType.ROLL: case NoteType.SLIDE: case NoteType.REPEAT: if (timeDiffAbs <= SCORE_TIMING_FLAWLESS) { return AccuracyType.FLAWLESS; } else if (timeDiffAbs <= SCORE_TIMING_PERFECT) { return AccuracyType.PERFECT; } else if (timeDiffAbs <= SCORE_TIMING_GREAT) { return AccuracyType.GREAT; } else if (timeDiffAbs <= SCORE_TIMING_GOOD) { return AccuracyType.GOOD; } else if (timeDiffAbs <= SCORE_TIMING_BAD) { return AccuracyType.BAD; } else { if (timeDiff > SCORE_TIMING_BAD) { return AccuracyType.MISS; } else { return AccuracyType.IGNORE; } } default: Logger.Error("Scores.GetAccuracyValue", String.Format("Incorrect noteEvent \"{0}\"", type)); return AccuracyType.IGNORE; } }
public Note(int ID, string Grade, string Name, NoteType Type) { this.ID = ID; this.Grade = Grade; this.Name = Name; this.Type = Type; }
internal MidNote(NoteType type, string section, int offset, int note) { Type = type; Section = section; Offset = offset; Note = note; }
public Note(Rectangle rectangle,NoteType color,NoteType trackColor) { Rectangle = rectangle; Color = color; TrackColor = trackColor; TargetPoint = GetTargetPoint(TrackColor); }
public Note(IPitchInfo pitchInfo, Duration duration, Notehead notehead = Notehead.Normal, int voice = 1, NoteType type = NoteType.Quarter) { PitchInfo = pitchInfo; Duration = duration; Notehead = notehead; Voice = voice; Type = type; }
public void ReInit(string strAll) { noteType = NoteType.NONE; m_strAllfuc = strAll; m_strFuncName = ""; m_strParas = ""; m_strReturn = ""; Init(); }
public void ReleaseAllNotes() { water1 = NoteType.NULL; water2 = NoteType.NULL; water3 = NoteType.NULL; water1Sprite.color = new Color (1, 1, 1); water2Sprite.color = new Color (1, 1, 1); water3Sprite.color = new Color (1, 1, 1); }
public void Assure_the_default_type_of_a_note_is_positive() { Given("a new retrospective note is created", () => _note = new RetrospectiveNote()); When("we fetch the type of the note", () => _type = _note.Type); Then("the note should be positive", () => _type.ShouldBe(NoteType.Positive)); }
public void addNote(NoteType note) { if (water1.Equals(NoteType.NULL)) { water1 = note; water1Sprite.color = getColorFromNoteType(note); } else if (water2.Equals(NoteType.NULL)) { water2 = note; water2Sprite.color = getColorFromNoteType(note); } else if (water3.Equals(NoteType.NULL)) { water3 = note; water3Sprite.color = getColorFromNoteType(note); } }
public static Color getColorFromNoteType(NoteType type, byte alpha = 255) { if (type.Equals(NoteType.ONE)) { return new Color32(40,102,210, alpha); } else if (type.Equals(NoteType.TWO)) { return new Color32(37,208,64, alpha); } else if (type.Equals(NoteType.THREE)) { return new Color32(250,255,65, alpha); } else if (type.Equals(NoteType.FOUR)) { return new Color32(244,40,42, alpha); } return new Color (0,0,0, alpha); }
/// <summary> /// Handles the SaveClick event of the modalDetails control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> protected void modalDetails_SaveClick( object sender, EventArgs e ) { int noteTypeId = 0; if ( hfIdValue.Value != string.Empty && !int.TryParse( hfIdValue.Value, out noteTypeId ) ) { noteTypeId = 0; } var rockContext = new RockContext(); var service = new NoteTypeService( rockContext ); NoteType noteType = null; if ( noteTypeId != 0 ) { noteType = service.Get( noteTypeId ); } if ( noteType == null ) { var orders = service.Queryable() .Where( t => t.EntityTypeId == ( entityTypePicker.SelectedEntityTypeId ?? 0 ) ) .Select( t => t.Order ) .ToList(); noteType = new NoteType(); noteType.Order = orders.Any() ? orders.Max( t => t ) + 1 : 0; service.Add( noteType ); } noteType.Name = tbName.Text; noteType.EntityTypeId = entityTypePicker.SelectedEntityTypeId ?? 0; noteType.EntityTypeQualifierColumn = ""; noteType.EntityTypeQualifierValue = ""; noteType.UserSelectable = cbUserSelectable.Checked; noteType.CssClass = tbCssClass.Text; noteType.IconCssClass = tbIconCssClass.Text; if ( noteType.IsValid ) { rockContext.SaveChanges(); NoteTypeCache.Flush( noteType.Id ); NoteTypeCache.FlushEntityNoteTypes(); hfIdValue.Value = string.Empty; modalDetails.Hide(); BindFilter(); BindGrid(); } }
public PivotPage() { this.InitializeComponent(); this.selectedPivot = NoteType.SimpleNote; this.NavigationCacheMode = NavigationCacheMode.Required; this.navigationHelper = new NavigationHelper(this); this.navigationHelper.LoadState += this.NavigationHelper_LoadState; this.navigationHelper.SaveState += this.NavigationHelper_SaveState; this.listViews[(int)NoteType.SimpleNote] = SimpleNotesList; this.listViews[(int)NoteType.TodoNote] = ToDoNotesList; this.listViews[(int)NoteType.PhotoNote] = PhotoNotesList; noteManagers.Add(new SimpleNoteManager()); noteManagers.Add(new TodoNoteManager()); noteManagers.Add(new PhotoNoteManager()); }
public bool isEqual(NoteType other) { if ((Green == other.Green) && (Red == other.Red) && (Yellow == other.Yellow) && (Blue == other.Blue) && (Orange == other.Orange)) { return true; } else { return false; } }
public static void Play(NoteCode name, NoteType length) { int noteValue = Convert.ToInt32(length); if(noteValue < 0 && !stop) { System.Threading.Thread.Sleep(Math.Abs(noteValue)); } else if (noteValue >= 0 && !stop) { Console.Beep(ConvertToHertz(name), noteValue); } else { return; } }
/// <summary> /// Raises the <see cref="E:System.Web.UI.Control.Init" /> event. /// </summary> /// <param name="e">An <see cref="T:System.EventArgs" /> object that contains the event data.</param> protected override void OnInit( EventArgs e ) { base.OnInit( e ); var contextEntity = this.ContextEntity(); if ( contextEntity != null ) { string noteTypeName = GetAttributeValue( "NoteType" ); var rockContext = new RockContext(); var service = new NoteTypeService( rockContext ); var noteType = service.Get( contextEntity.TypeId, noteTypeName ); // If a note type with the specified name does not exist for the context entity type, create one if ( noteType == null ) { noteType = new NoteType(); noteType.IsSystem = false; noteType.EntityTypeId = contextEntity.TypeId; noteType.EntityTypeQualifierColumn = string.Empty; noteType.EntityTypeQualifierValue = string.Empty; noteType.Name = noteTypeName; service.Add( noteType ); rockContext.SaveChanges(); } notesTimeline.NoteTypeId = noteType.Id; notesTimeline.EntityId = contextEntity.Id; notesTimeline.Title = GetAttributeValue( "Heading" ); if ( string.IsNullOrWhiteSpace( notesTimeline.Title ) ) { notesTimeline.Title = noteType.Name; } notesTimeline.TitleIconCssClass = GetAttributeValue( "HeadingIcon" ); notesTimeline.Term = GetAttributeValue( "NoteTerm" ); notesTimeline.DisplayType = GetAttributeValue( "DisplayType" ) == "Light" ? NoteDisplayType.Light : NoteDisplayType.Full; notesTimeline.UsePersonIcon = GetAttributeValue( "UsePersonIcon" ).AsBoolean(); notesTimeline.ShowAlertCheckBox = GetAttributeValue( "ShowAlertCheckbox" ).AsBoolean(); notesTimeline.ShowPrivateCheckBox = GetAttributeValue( "ShowPrivateCheckbox" ).AsBoolean(); notesTimeline.ShowSecurityButton = GetAttributeValue( "ShowSecurityButton" ).AsBoolean(); notesTimeline.AllowAnonymousEntry = GetAttributeValue( "Allow Anonymous" ).AsBoolean(); notesTimeline.AddAlwaysVisible = GetAttributeValue( "AddAlwaysVisible" ).AsBoolean(); notesTimeline.SortDirection = GetAttributeValue( "DisplayOrder" ) == "Ascending" ? ListSortDirection.Ascending : ListSortDirection.Descending; } }
public Note(int value) { switch (value) { case 255: this.Type = NoteType.Empty; break; case 254: this.Type = NoteType.NoteOff; break; default: this.Type = NoteType.Pitched; break; } if (this.Type == NoteType.Pitched) { this.Octave = 1 + (value >> 4); this.Pitch = pitches[value & 15]; } }
public void HitNote(NoteType color) { switch (color) { case NoteType.Red: RedHit = true; break; case NoteType.Yellow: YellowHit = true; break; case NoteType.Blue: BlueHit = true; break; case NoteType.Green: GreenHit = true; break; case NoteType.Orange: OrangeHit = true; break; } }
public ScoreResult ScoreUserInput( NoteType userEnteredNote, NoteType noteType ) { int pointsScored = _gameConfig.PointsGainedWhenCorrect; ScoreResult result = ScoreResult.Correct; if ( userEnteredNote != noteType && _currentNoteLocation != _gameConfig.PositionOfTargetArea ) { pointsScored = _gameConfig.PointsLostWhenWrongNoteAndTime; result = ScoreResult.WrongTimeAndNote; } else if ( userEnteredNote != noteType ) { pointsScored = _gameConfig.PointsLostWhenWrongNote; result = ScoreResult.WrongNote; } else if ( _currentNoteLocation != _gameConfig.PositionOfTargetArea ) { pointsScored = _gameConfig.PointsLostWhenWrongTime; result = ScoreResult.WrongTime; } _totalScore += pointsScored; return result; }
public static decimal NoteTypeToFraction(NoteType noteType) { switch (noteType) { case NoteType.Whole: return 1; case NoteType.Half: return (decimal)0.5; case NoteType.Quarter: return (decimal)0.25; case NoteType.Eighth: return (decimal)1 / 8; case NoteType.Sixteenth: return (decimal)1 / 16; case NoteType.ThirtySecond: return (decimal)1 / 32; case NoteType.SixtyFourth: return (decimal)1 / 64; case NoteType.HundredTwentyEighth: return (decimal)1 / 128; case NoteType.TwoHundredAndSixtyFifth: return (decimal)1 / 256; } return 1; }
private void GetNoteType() { string noteTypeName = GetAttributeValue( "NoteType" ); var service = new NoteTypeService(); noteType = service.Get( contextEntity.TypeId, noteTypeName ); // If a note type with the specified name does not exist for the context entity type, create one if ( noteType == null ) { noteType = new NoteType(); noteType.IsSystem = false; noteType.EntityTypeId = contextEntity.TypeId; noteType.EntityTypeQualifierColumn = string.Empty; noteType.EntityTypeQualifierValue = string.Empty; noteType.Name = noteTypeName; service.Add( noteType, CurrentPersonId ); service.Save( noteType, CurrentPersonId ); } }
/// <summary> /// Maps the notes. /// </summary> /// <param name="tableData">The table data.</param> public void MapNotes( IQueryable<Row> tableData ) { var lookupContext = new RockContext(); var categoryService = new CategoryService( lookupContext ); var personService = new PersonService( lookupContext ); var noteTypes = new NoteTypeService( lookupContext ).Queryable().AsNoTracking().ToList(); var personalNoteType = noteTypes.FirstOrDefault( nt => nt.Guid == new Guid( Rock.SystemGuid.NoteType.PERSON_TIMELINE_NOTE ) ); var importedUsers = new UserLoginService( lookupContext ).Queryable().AsNoTracking() .Where( u => u.ForeignId != null ) .ToDictionary( t => t.ForeignId, t => t.PersonId ); var noteList = new List<Note>(); int completed = 0; int totalRows = tableData.Count(); int percentage = ( totalRows - 1 ) / 100 + 1; ReportProgress( 0, string.Format( "Verifying note import ({0:N0} found).", totalRows ) ); foreach ( var row in tableData.Where( r => r != null ) ) { string text = row["Note_Text"] as string; int? individualId = row["Individual_ID"] as int?; int? householdId = row["Household_ID"] as int?; var noteTypeActive = row["NoteTypeActive"] as Boolean?; bool noteArchived = false; if ( row.Columns.FirstOrDefault( v => v.Name.Equals( "IsInactive" ) ) != null ) { /* ===================================================================== * the NoteArchived column *should* work, but OrcaMDF won't read it... * instead check for a manually added column: IsInactive int null * var noteActive = row["NoteArchived"] as Boolean?; * if ( noteActive == null ) throw new NullReferenceException(); /* ===================================================================== */ var rowInactiveValue = row["IsInactive"] as int?; noteArchived = rowInactiveValue.Equals( 1 ); } var personKeys = GetPersonKeys( individualId, householdId ); if ( personKeys != null && !string.IsNullOrWhiteSpace( text ) && noteTypeActive == true && !noteArchived ) { DateTime? dateCreated = row["NoteCreated"] as DateTime?; string noteType = row["Note_Type_Name"] as string; var note = new Note(); note.CreatedDateTime = dateCreated; note.EntityId = personKeys.PersonId; // These replace methods don't like being chained together text = Regex.Replace( text, @"\t|\ ", " " ); text = text.Replace( "-", "-" ); text = text.Replace( "<", "<" ); text = text.Replace( ">", ">" ); text = text.Replace( "&", "&" ); text = text.Replace( """, @"""" ); text = text.Replace( "
", string.Empty ); note.Text = text.Trim(); int? userId = row["NoteCreatedByUserID"] as int?; if ( userId != null && importedUsers.ContainsKey( userId ) ) { var userKeys = ImportedPeople.FirstOrDefault( p => p.PersonId == (int)importedUsers[userId] ); if ( userKeys != null ) { note.CreatedByPersonAliasId = userKeys.PersonAliasId; } } int? matchingNoteTypeId = null; if ( !noteType.StartsWith( "General", StringComparison.InvariantCultureIgnoreCase ) ) { matchingNoteTypeId = noteTypes.Where( nt => nt.Name == noteType ).Select( i => (int?)i.Id ).FirstOrDefault(); } else { matchingNoteTypeId = personalNoteType.Id; } if ( matchingNoteTypeId != null ) { note.NoteTypeId = (int)matchingNoteTypeId; } else { // create the note type var newNoteType = new NoteType(); newNoteType.EntityTypeId = personalNoteType.EntityTypeId; newNoteType.EntityTypeQualifierColumn = string.Empty; newNoteType.EntityTypeQualifierValue = string.Empty; newNoteType.UserSelectable = true; newNoteType.IsSystem = false; newNoteType.Name = noteType; newNoteType.Order = 0; lookupContext.NoteTypes.Add( newNoteType ); lookupContext.SaveChanges( DisableAuditing ); noteTypes.Add( newNoteType ); note.NoteTypeId = newNoteType.Id; } noteList.Add( note ); completed++; if ( completed % percentage < 1 ) { int percentComplete = completed / percentage; ReportProgress( percentComplete, string.Format( "{0:N0} notes imported ({1}% complete).", completed, percentComplete ) ); } else if ( completed % ReportingNumber < 1 ) { SaveNotes( noteList ); ReportPartialProgress(); noteList.Clear(); } } } if ( noteList.Any() ) { SaveNotes( noteList ); } ReportProgress( 100, string.Format( "Finished note import: {0:N0} notes imported.", completed ) ); }
/// <summary> /// /// </summary> /// <param name="text"></param> /// <param name="type"></param> public Note(string text, NoteType type) : this(type) { this.Value = text; }
public Note(NoteType type, string captionId, string textId) : this(type, captionId, textId, true) { }
/// <summary> /// /// </summary> /// <param name="type"></param> public Note(NoteType type) : this() { this.Type = type; }
public Notification(PrizeType p_prize) { noteType = NoteType.DISCOVERY; prize = p_prize; }
public Notification(BaddyType p_monster) { noteType = NoteType.ENCOUNTER; monster = p_monster; }
public Notification(NoteType p_noteType) { noteType = p_noteType; }
string textureFor(NoteType nType) { if (nType == NoteType.ENCOUNTER) return "encounter"; //if (nType == NoteType.DISCOVERY) return "discovery"; }