Ejemplo n.º 1
0
        public static async Task <Constellation> Constellation(string ID, string RN = null, string RID = null)
        {
            JObject jConst = await ESIGenericRequests.GetConstInfo(ID);

            if (RN == null && RID == null)
            {
                RID = jConst["region_id"].ToString();
                var r = await ESIGenericRequests.GetRegionInfo(RID);

                RN = r["name"].ToString();
            }
            string CN  = jConst["name"].ToString();
            string CID = jConst["constellation_id"].ToString();

            await SystemDB.constlog.WriteLineAsync(jConst.ToString());

            JArray        jSystems   = (JArray)jConst["systems"];
            List <System> SystemList = new List <System>();

            foreach (var element in jSystems)
            {
                SystemList.Add(System.Create(await _System(element.ToString()), CN, CID, RN, RID));
            }

            Constellation constellation = new Constellation(jConst["name"].ToString(), SystemList);

            return(constellation);
        }
Ejemplo n.º 2
0
 public static void CreateJConstellation(Constellation constellation)
 {
     using (var driver = GraphDatabase.Driver(new Uri("bolt://localhost:7687"), AuthTokens.Basic(Program.db_username, Program.db_password)))
     {
         using (var session = driver.Session())
         {
             Console.WriteLine($"Added {constellation.name}");
             SystemDB.textlog.WriteLine($"Added {constellation.name}");
             session.WriteTransaction(tx =>
             {
                 tx.Run($"CREATE (a:JConstellation{{name:'{constellation.name}', class:'{GetJProps.GetClass(constellation.SList.First().id)}'}})");
             });
         }
     }
 }