Skip to content

Commit

Permalink
Rename Set -> CellSet
Browse files Browse the repository at this point in the history
  • Loading branch information
Majiir committed Sep 1, 2014
1 parent d09ce32 commit dbd70d7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Plugin/GeodesicGrid/Set.cs → Plugin/GeodesicGrid/CellSet.cs
Expand Up @@ -4,16 +4,16 @@

namespace Kethane.GeodesicGrid
{
public class Set : IEnumerable<Cell>
public class CellSet : IEnumerable<Cell>
{
private readonly BitArray set;

public Set(int level)
public CellSet(int level)
{
this.set = new BitArray((int)Cell.CountAtLevel(level));
}

public Set(int level, byte[] array)
public CellSet(int level, byte[] array)
{
this.set = new BitArray(array);
this.set.Length = (int)Cell.CountAtLevel(level);
Expand Down
2 changes: 1 addition & 1 deletion Plugin/Kethane.csproj
Expand Up @@ -50,7 +50,7 @@
<Compile Include="CellularResourceGenerator.cs" />
<Compile Include="CompatibilityChecker.cs" />
<Compile Include="GeodesicGrid\CellMap.cs" />
<Compile Include="GeodesicGrid\Set.cs" />
<Compile Include="GeodesicGrid\CellSet.cs" />
<Compile Include="InstallCleanup.cs" />
<Compile Include="IWindowToggle.cs" />
<Compile Include="LegacyResourceGenerator.cs" />
Expand Down
10 changes: 5 additions & 5 deletions Plugin/KethaneData.cs
Expand Up @@ -29,7 +29,7 @@ public static KethaneData Current
}

public Dictionary<string, Dictionary<string, IBodyResources>> PlanetDeposits = new Dictionary<string,Dictionary<string,IBodyResources>>();
public Dictionary<string, Dictionary<string, Set>> Scans = new Dictionary<string,Dictionary<string,Set>>();
public Dictionary<string, Dictionary<string, CellSet>> Scans = new Dictionary<string,Dictionary<string,CellSet>>();

private Dictionary<string, ConfigNode> generatorNodes = new Dictionary<string, ConfigNode>();
private Dictionary<string, IResourceGenerator> generators = new Dictionary<string, IResourceGenerator>();
Expand Down Expand Up @@ -82,7 +82,7 @@ public override void OnLoad(ConfigNode config)
var resourceNode = resourceNodes.SingleOrDefault(n => n.GetValue("Resource") == resourceName) ?? new ConfigNode();

PlanetDeposits[resourceName] = new Dictionary<string, IBodyResources>();
Scans[resourceName] = new Dictionary<string, Set>();
Scans[resourceName] = new Dictionary<string, CellSet>();

generatorNodes[resourceName] = resourceNode.GetNode("Generator") ?? resource.Generator;
var generator = createGenerator(generatorNodes[resourceName].CreateCopy());
Expand All @@ -100,14 +100,14 @@ public override void OnLoad(ConfigNode config)
var bodyNode = bodyNodes.SingleOrDefault(n => n.GetValue("Name") == body.name) ?? new ConfigNode();

PlanetDeposits[resourceName][body.name] = generator.Load(body, bodyNode.GetNode("GeneratorData"));
Scans[resourceName][body.name] = new Set(MapOverlay.GridLevel);
Scans[resourceName][body.name] = new CellSet(MapOverlay.GridLevel);

var scanMask = bodyNode.GetValue("ScanMask");
if (scanMask != null)
{
try
{
Scans[resourceName][body.name] = new Set(MapOverlay.GridLevel, Misc.FromBase64String(scanMask));
Scans[resourceName][body.name] = new CellSet(MapOverlay.GridLevel, Misc.FromBase64String(scanMask));
}
catch (FormatException e)
{
Expand All @@ -127,7 +127,7 @@ public override void OnLoad(ConfigNode config)
foreach (var body in FlightGlobals.Bodies)
{
var old = Scans[resource.Resource][body.name];
var set = new Set(MapOverlay.GridLevel);
var set = new CellSet(MapOverlay.GridLevel);

foreach (var cell in Cell.AtLevel(MapOverlay.GridLevel))
{
Expand Down

0 comments on commit dbd70d7

Please sign in to comment.