Skip to content

Commit

Permalink
Updated testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Somfic committed Oct 22, 2018
1 parent c7ac492 commit 2c968d9
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions Test/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
using System;
using System.Threading;
using System.Collections.Generic;

using System.IO;

using EliteAPI;
using EliteAPI.EDDB;

using Newtonsoft.Json;
using System.Linq;

namespace Example
{
Expand All @@ -14,15 +19,19 @@ static void Main(string[] args)
EliteDangerousAPI EliteAPI = new EliteDangerousAPI(new DirectoryInfo($@"C:\Users\{Environment.UserName}\Saved Games\Frontier Developments\Elite Dangerous"));
EliteAPI.Start();

EliteAPI.DockedEvent += EliteAPI_DockedEvent;
EliteAPI.EDDB.UpdateData(DataRequests.Prices);

Thread.Sleep(-1);
}
Console.WriteLine("Searching..");

private static void EliteAPI_DockedEvent(object sender, DockedInfo e)
{
//This method will be ran every time the player docks.
Console.WriteLine($"Docked at {e.StationName}.");
var Fusang = EliteAPI.EDDB.GetSystemByName("Fusang");
var CleveVision = EliteAPI.EDDB.GetStationsBySystem(Fusang).First(x => x.name == "Cleve Vision");

Console.WriteLine(JsonConvert.SerializeObject(CleveVision));

Fusang = null;
CleveVision = null;

Thread.Sleep(-1);
}
}
}

0 comments on commit 2c968d9

Please sign in to comment.