Skip to content

Commit

Permalink
Rename the method in the change handler.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy840119 committed Jan 16, 2024
1 parent cd954df commit 38a6ed2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void TestSetTimeTagTime()
}

[Test]
public void TestSetTimeTagInitialRomaji()
public void TestSetTimeTagFirstSyllable()
{
var timeTag = new TimeTag(new TextIndex(), 1000);
PrepareHitObject(() => new Lyric
Expand All @@ -50,7 +50,7 @@ public void TestSetTimeTagInitialRomaji()
},
});

TriggerHandlerChanged(c => c.SetTimeTagInitialRomaji(timeTag, true));
TriggerHandlerChanged(c => c.SetTimeTagFirstSyllable(timeTag, true));

AssertSelectedHitObject(_ =>
{
Expand All @@ -59,7 +59,7 @@ public void TestSetTimeTagInitialRomaji()
}

[Test]
public void TestSetTimeTagRomajiText()
public void TestSetTimeTagRomanizedSyllable()
{
var timeTag = new TimeTag(new TextIndex(), 1000);
PrepareHitObject(() => new Lyric
Expand All @@ -71,14 +71,14 @@ public void TestSetTimeTagRomajiText()
},
});

TriggerHandlerChanged(c => c.SetTimeTagRomajiText(timeTag, "karaoke"));
TriggerHandlerChanged(c => c.SetTimeTagRomanizedSyllable(timeTag, "karaoke"));

AssertSelectedHitObject(_ =>
{
Assert.AreEqual("karaoke", timeTag.RomanizedSyllable);
});

TriggerHandlerChanged(c => c.SetTimeTagRomajiText(timeTag, " "));
TriggerHandlerChanged(c => c.SetTimeTagRomanizedSyllable(timeTag, " "));

AssertSelectedHitObject(_ =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ public interface ILyricTimeTagsChangeHandler : ILyricListPropertyChangeHandler<T
{
void SetTimeTagTime(TimeTag timeTag, double time);

void SetTimeTagInitialRomaji(TimeTag timeTag, bool initialRomaji);
void SetTimeTagFirstSyllable(TimeTag timeTag, bool firstSyllable);

void SetTimeTagRomajiText(TimeTag timeTag, string romaji);
void SetTimeTagRomanizedSyllable(TimeTag timeTag, string? romanizedSyllable);

void ShiftingTimeTagTime(IEnumerable<TimeTag> timeTags, double offset);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void SetTimeTagTime(TimeTag timeTag, double time)
});
}

public void SetTimeTagInitialRomaji(TimeTag timeTag, bool initialRomaji)
public void SetTimeTagFirstSyllable(TimeTag timeTag, bool firstSyllable)
{
CheckExactlySelectedOneHitObject();

Expand All @@ -37,11 +37,11 @@ public void SetTimeTagInitialRomaji(TimeTag timeTag, bool initialRomaji)
if (!containsInLyric)
throw new InvalidOperationException($"{nameof(timeTag)} is not in the lyric");

timeTag.FirstSyllable = initialRomaji;
timeTag.FirstSyllable = firstSyllable;
});
}

public void SetTimeTagRomajiText(TimeTag timeTag, string romaji)
public void SetTimeTagRomanizedSyllable(TimeTag timeTag, string? romanizedSyllable)
{
CheckExactlySelectedOneHitObject();

Expand All @@ -51,9 +51,9 @@ public void SetTimeTagRomajiText(TimeTag timeTag, string romaji)
if (!containsInLyric)
throw new InvalidOperationException($"{nameof(timeTag)} is not in the lyric");

timeTag.RomanizedSyllable = romaji;
timeTag.RomanizedSyllable = romanizedSyllable;

if (!string.IsNullOrWhiteSpace(romaji))
if (!string.IsNullOrWhiteSpace(romanizedSyllable))
return;

timeTag.RomanizedSyllable = string.Empty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ protected override string GetFieldValue(TimeTag timeTag)
=> timeTag.RomanizedSyllable ?? string.Empty;

protected override void ApplyValue(TimeTag timeTag, string value)
=> lyricTimeTagsChangeHandler.SetTimeTagRomajiText(timeTag, value);
=> lyricTimeTagsChangeHandler.SetTimeTagRomanizedSyllable(timeTag, value);

[BackgroundDependencyLoader]
private void load()
Expand All @@ -124,7 +124,7 @@ protected override bool GetFieldValue(TimeTag timeTag)
=> timeTag.FirstSyllable;

protected override void ApplyValue(TimeTag timeTag, bool value)
=> lyricTimeTagsChangeHandler.SetTimeTagInitialRomaji(timeTag, value);
=> lyricTimeTagsChangeHandler.SetTimeTagFirstSyllable(timeTag, value);

[BackgroundDependencyLoader]
private void load(IEditRomajiModeState editRomajiModeState)
Expand Down

0 comments on commit 38a6ed2

Please sign in to comment.