Skip to content

Commit 8554427

Browse files
committed
✨ add events
1 parent fa37d73 commit 8554427

265 files changed

Lines changed: 9614 additions & 1032 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Console/Program.cs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
using EliteAPI;
2-
using EliteAPI.Journals;
32

43
var api = new EliteDangerousApi();
5-
api.OnAllJson(e => Console.WriteLine($"{e.eventName}: {e.json}"));
64

7-
var json = await File.ReadAllTextAsync("./EliteAPI.Tests/TestFiles/Status/StatusCombat.json");
8-
var paths = JournalUtils.ToPaths(json);
5+
api.Start();
96

10-
foreach (var path in paths)
7+
api.OnAll(e =>
118
{
12-
Console.WriteLine($"{path.Path}: {path.Value} ({path.Type})");
13-
}
9+
Console.WriteLine($"Event: {e.Event}");
10+
});
11+
12+
api.OnJournalChanged(e =>
13+
{
14+
Console.WriteLine($"New journal file being watched: {e.FullName}");
15+
});
16+
17+
// api.OnAllJson(e =>
18+
// {
19+
// Console.WriteLine($"JSON Event: {e.eventName}");
20+
// });
21+
22+
await Task.Delay(-1);

EliteAPI.Tests/EventTriggeringTests.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
using EliteAPI.Journals;
2-
using EliteAPI.Json;
3-
using FluentAssertions;
4-
51
namespace EliteAPI.Tests;
62

73
public class EventTriggeringTests

0 commit comments

Comments
 (0)