Resolve runtime factions through typed galaxy projection
This commit is contained in:
parent
de36150dc2
commit
c43d7b8f67
5 changed files with 47 additions and 9 deletions
|
|
@ -467,6 +467,22 @@ public class Galaxy
|
|||
return _containedFactions.Contains(factionID);
|
||||
}
|
||||
|
||||
public Faction ResolveFaction(Guid factionID)
|
||||
{
|
||||
if (factionID == Guid.Empty)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var faction = Factions.FirstOrDefault(f => f.ID == factionID);
|
||||
if (faction != null)
|
||||
{
|
||||
return faction;
|
||||
}
|
||||
|
||||
return _allFactions.FirstOrDefault(f => f.ID == factionID);
|
||||
}
|
||||
|
||||
class DijkstraVertex
|
||||
{
|
||||
public float Cost;
|
||||
|
|
|
|||
Loading…
Reference in a new issue