Skip to content

Commit

Permalink
zkill feed, tidy up, colours fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BitBaboonSteve committed Mar 25, 2018
1 parent 4bdf3c5 commit 078849a
Show file tree
Hide file tree
Showing 21 changed files with 494 additions and 168 deletions.
1 change: 1 addition & 0 deletions EVEData/Anom.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//-----------------------------------------------------------------------
// EVE Anoms
//-----------------------------------------------------------------------

using System;

namespace SMT.EVEData
Expand Down
1 change: 1 addition & 0 deletions EVEData/AnomData.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//-----------------------------------------------------------------------
// EVE Anom Data
//-----------------------------------------------------------------------

using System.Collections.Generic;
using System.Linq;

Expand Down
1 change: 1 addition & 0 deletions EVEData/AnomManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//-----------------------------------------------------------------------
// EVE AnomManager
//-----------------------------------------------------------------------

using System.ComponentModel;
using System.Linq;

Expand Down
1 change: 1 addition & 0 deletions EVEData/Character.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//-----------------------------------------------------------------------
// EVE AnomManager
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
Expand Down
File renamed without changes.
47 changes: 32 additions & 15 deletions EVEData/EveManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//-----------------------------------------------------------------------
// EVE Manager
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
Expand Down Expand Up @@ -188,13 +189,29 @@ public static EveManager Instance
/// <summary>
/// Gets or sets the Name to System dictionary
/// </summary>
private Dictionary<string, System> NameToSystem { get; set; }
private Dictionary<string, System> NameToSystem { get; }

/// <summary>
/// Gets or sets the current list of intel filters used to monitor the local log files
/// </summary>
private List<string> IntelFilters { get; set; }

/// <summary>
/// Get the System name from the System ID
/// </summary>
/// <param name="id">System ID</param>
/// <returns>System Name</returns>
public string GetSystemNameFromSystemID(string id)
{
string name = string.Empty;
if (SystemIDToName.Keys.Contains(id))
{
name = SystemIDToName[id];
}

return name;
}

/// <summary>
/// Get the alliance name from the alliance ID
/// </summary>
Expand Down Expand Up @@ -625,7 +642,7 @@ public void CreateFromScratch()
s.ActualX = x;
s.ActualY = y;
s.ActualZ = z;
s.Security = security;
s.TrueSec = security;
s.ConstellationID = constID;
}
}
Expand Down Expand Up @@ -781,10 +798,7 @@ public void LoadFromDisk()
/// Does the System Exist ?
/// </summary>
/// <param name="name">Name (not ID) of the system</param>
public bool DoesSystemExist(string name)
{
return GetEveSystem(name) != null;
}
public bool DoesSystemExist(string name) => GetEveSystem(name) != null;

/// <summary>
/// Get a System object from the name, note : for regions which have other region systems in it wont return
Expand Down Expand Up @@ -1112,17 +1126,12 @@ private void IntelFileWatcher_Changed(object sender, FileSystemEventArgs e)
string l = file.ReadLine();
fileReadFrom++;

if (l.Contains("Channel ID"))
// explicitly skip just "local"
if(l.Contains("Channel Name: Local"))
{
string temp = l.Split(',')[1].Split(')')[0].Trim();
if (SystemIDToName.Keys.Contains(temp))
{
system = SystemIDToName[temp];
}

// now can read the next line
l = file.ReadLine(); // should be the "Channel Name : Local"
l = file.ReadLine();
l = file.ReadLine(); // should be the "Listener : <CharName>"
fileReadFrom++;

characterName = l.Split(':')[1].Trim();

Expand All @@ -1143,6 +1152,8 @@ private void IntelFileWatcher_Changed(object sender, FileSystemEventArgs e)
{
LocalCharacters.Add(new EVEData.Character(characterName, changedFile, system));
}), DispatcherPriority.ApplicationIdle);


}

break;
Expand Down Expand Up @@ -1173,6 +1184,12 @@ private void IntelFileWatcher_Changed(object sender, FileSystemEventArgs e)
line = line.Substring(line.IndexOf("["));
}

if(line == "")
{
line = file.ReadLine();
continue;
}

fileReadFrom++;

if (localChat)
Expand Down
6 changes: 4 additions & 2 deletions EVEData/Fleet.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//-----------------------------------------------------------------------
// Fleet
//-----------------------------------------------------------------------

using System.Collections.ObjectModel;

namespace SMT.EVEData
Expand Down Expand Up @@ -49,14 +50,15 @@ public Fleet()
public struct FleetMember
{
/// <summary>
/// Fleet Member Character name
/// Gets or sets Fleet Member Character name
/// </summary>
public string Name { get; set; }

/// <summary>
/// Fleet member Location
/// Gets or sets Fleet member Location
/// </summary>
public string Location { get; set; }

public override string ToString() => Name;
}
}
Expand Down
9 changes: 4 additions & 5 deletions EVEData/IntelData.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//-----------------------------------------------------------------------
// Intel Data
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;

Expand All @@ -12,8 +13,9 @@ namespace SMT.EVEData
public class IntelData
{
/// <summary>
/// Initializes a new instance of the <see cref="IntelData" /> class
/// Initializes a new instance of the <see cref="IntelData" /> class
/// </summary>
/// <param name="intelText">the raw line of text from the log file</param>
public IntelData(string intelText)
{
RawIntelString = intelText;
Expand Down Expand Up @@ -45,9 +47,6 @@ public IntelData(string intelText)
/// </summary>
public List<string> Systems { get; set; }

public override string ToString()
{
return "[" + IntelTime.ToString("HH:mm") + "] " + IntelString;
}
public override string ToString() => "[" + IntelTime.ToString("HH:mm") + "] " + IntelString;
}
}
28 changes: 21 additions & 7 deletions EVEData/JumpBridge.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
namespace SMT.EVEData
//-----------------------------------------------------------------------
// Jump Bridge
//-----------------------------------------------------------------------

namespace SMT.EVEData
{
/// <summary>
/// A Player owned link between systems
/// </summary>
public class JumpBridge
{
/// <summary>
/// Initializes a new instance of the <see cref="JumpBridge" /> class.
/// </summary>
public JumpBridge()
{
}

/// <summary>
/// Initializes a new instance of the <see cref="JumpBridge" /> class.
/// </summary>
/// <param name="f">From</param>
/// <param name="fi">From Info</param>
/// <param name="t">To</param>
/// <param name="ti">ToInfo</param>
/// <param name="friend">Is Friendly?</param>
public JumpBridge(string f, string fi, string t, string ti, bool friend)
{
From = f;
Expand All @@ -19,29 +34,28 @@ public JumpBridge(string f, string fi, string t, string ti, bool friend)
}

/// <summary>
/// Starting System
/// Gets or sets the starting System
/// </summary>
public string From { get; set; }

/// <summary>
/// Starting System Location (Planet-Moon)
/// Gets or sets the starting system location info(Planet-Moon)
/// </summary>
public string FromInfo { get; set; }

/// <summary>
/// Ending System
/// Gets or sets the ending System
/// </summary>
public string To { get; set; }

/// <summary>
/// Ending System Location (Planet-Moon)
/// Gets or sets the ending system Location info usually (Planet-Moon)
/// </summary>
public string ToInfo { get; set; }

/// <summary>
/// Is this a friendly or hostile Jumpbridge
/// Gets or sets if this is a friendly or hostile Jump bridge
/// </summary>
public bool Friendly { get; set; }

}
}
73 changes: 52 additions & 21 deletions EVEData/MapRegion.cs
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
using System.Collections.Generic;
//-----------------------------------------------------------------------
// Map Region
//-----------------------------------------------------------------------

using System.Collections.Generic;
using System.Linq;

namespace SMT.EVEData
{
/// <summary>
/// Represents a Map of a Region (will have out of region systems on the map)
/// </summary>
public class MapRegion
{
/// <summary>
/// English Name of this region
/// </summary>
public string Name { get; set; }

public string Faction { get; set; }

public double RegionX { get; set; }

public double RegionY { get; set; }

/// <summary>
/// "Name" on Dotlan, used in URL's etc
/// Initializes a new instance of the <see cref="MapRegion" /> class.
/// </summary>
public string DotLanRef { get; set; }

public SerializableDictionary<string, MapSystem> MapSystems { get; set; }

public List<string> RegionLinks { get; set; }

public MapRegion()
{
MapSystems = new SerializableDictionary<string, MapSystem>();
RegionLinks = new List<string>();
}

/// <summary>
/// Initializes a new instance of the <see cref="MapRegion" /> class.
/// </summary>
/// <param name="name">Name of the Region</param>
/// <param name="faction">Faction (if any) of the region</param>
/// <param name="regionX">X Location to render this on the universe map</param>
/// <param name="regionY">Y Location to render this on the universe map</param>
public MapRegion(string name, string faction, double regionX, double regionY)
{
Name = name;
Expand All @@ -40,16 +37,50 @@ public MapRegion(string name, string faction, double regionX, double regionY)
RegionX = regionX;
RegionY = regionY;



MapSystems = new SerializableDictionary<string, MapSystem>();
RegionLinks = new List<string>();
}

/// <summary>
/// Gets or sets the English name of this region
/// </summary>
public string Name { get; set; }

/// <summary>
/// Gets or sets the Regions Faction name
/// </summary>
public string Faction { get; set; }

/// <summary>
/// Gets or sets the Regions X coord on the universe map
/// </summary>
public double RegionX { get; set; }

/// <summary>
/// Gets or sets the Regions Y coord on the universe map
/// </summary>
public double RegionY { get; set; }

/// <summary>
/// Gets or sets the "Name" on Dotlan, used in URL's etc
/// </summary>
public string DotLanRef { get; set; }

/// <summary>
/// Gets or sets the dictionary of systems on this map
/// </summary>
public SerializableDictionary<string, MapSystem> MapSystems { get; set; }

/// <summary>
/// Gets or sets the list of links to other Regions
/// </summary>
public List<string> RegionLinks { get; set; }

/// <summary>
/// Is the System on this region map : note as we're using the dotlan layout we have out of region systems on the map for navigability reasons
/// </summary>
/// <param name="name">Name of the System to Check</param>
/// <returns></returns>
public bool IsSystemOnMap(string name)
{
// to catch out of region systems on the current map, ie region boundaries or strange intra-region settings
Expand Down
Loading

0 comments on commit 078849a

Please sign in to comment.