Skip to content

Commit

Permalink
Refactor a code
Browse files Browse the repository at this point in the history
  • Loading branch information
milchchan committed Dec 12, 2023
1 parent fb6dd06 commit 9c51cd5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Apricot/Agent.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ public Agent(string name)

character.Likes += 1;

Script.Instance.TryEnqueue(Script.Instance.Prepare(from sequence in Script.Instance.Sequences where sequence.Name!.Equals("Like") && sequence.Owner!.Equals(this.characterName) select sequence, character.Likes.ToString(System.Globalization.CultureInfo.InvariantCulture)));
Script.Instance.Run(from sequence in Script.Instance.Sequences where sequence.Name!.Equals("Like") && sequence.Owner!.Equals(this.characterName) select sequence, character.Likes.ToString(System.Globalization.CultureInfo.InvariantCulture));

backgroundBrush = new SolidColorBrush(Color.FromArgb((byte)(backgroundColor.A * 75 / 100), backgroundColor.R, backgroundColor.G, backgroundColor.B));

Expand Down Expand Up @@ -3871,7 +3871,7 @@ protected override void OnMouseDoubleClick(MouseButtonEventArgs e)

foreach (Motion motion in query)
{
Script.Instance.TryEnqueue(Script.Instance.Prepare(q, motion.Current.Path));
Script.Instance.Run(q, motion.Current.Path);
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions Apricot/Script.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5743,6 +5743,11 @@ public void Resume()
}
}

public void Run(IEnumerable<Sequence> sequences, string? state)
{
TryEnqueue(Prepare(sequences, state));
}

public IEnumerable<Sequence> Prepare(IEnumerable<Sequence> sequences, string? state)
{
return Prepare(sequences, state, delegate (IEnumerable<Sequence> collection)
Expand Down
2 changes: 1 addition & 1 deletion Weather/WeatherExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ private async void Update(Geocoordinate geocoordinate)

while (queue.Count > 0)
{
Script.Instance.TryEnqueue(Script.Instance.Prepare(sequenceList, queue.Dequeue()));
Script.Instance.Run(sequenceList, queue.Dequeue());
}
}
}
Expand Down

0 comments on commit 9c51cd5

Please sign in to comment.