Delete commented-out code blocks

Git keeps the history. SimpleCommodityData records its retired
MessagePack keys so they are not reused against old data.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-11 22:14:58 +02:00
commit 3dcfaf9783
15 changed files with 1 additions and 381 deletions

View file

@ -35,21 +35,6 @@ public class CultCache
private readonly Dictionary<Type, DatabaseEntry> _globals = new Dictionary<Type, DatabaseEntry>();
private readonly Dictionary<Type, HashSet<DatabaseEntry>> _types = new Dictionary<Type, HashSet<DatabaseEntry>>();
// private readonly Dictionary<Type, (DirectoryInfo directory, List<Guid> entries)> _externalTypes = new Dictionary<Type, (DirectoryInfo directory, List<Guid> entries)>();
// private class ExternalEntry
// {
// public string FilePath;
// public DatabaseEntry Entry;
//
// public ExternalEntry(string filePath, DatabaseEntry entry)
// {
// FilePath = filePath;
// Entry = entry;
// }
// }
// private readonly Dictionary<Guid, ExternalEntry> _externalEntries = new Dictionary<Guid, ExternalEntry>();
public IEnumerable<DatabaseEntry> AllEntries => _entries.Values;
public CultCache()

View file

@ -845,42 +845,6 @@ public abstract class Entity
yield return b;
}
// public IEnumerable<(T t, Switch s)> GetSwitch<T>() where T : class, IBehavior
// {
// foreach (var equippedItem in Equipment)
// foreach (var group in equippedItem.BehaviorGroups.Values)
// foreach(var behavior in group.Behaviors)
// if (behavior is T t)
// {
// var s = group.GetExposed<Switch>();
// if (s != null) yield return (t, s);
// }
// }
//
// public IEnumerable<(T behavior, Trigger trigger)> GetTrigger<T>() where T : class, IBehavior
// {
// foreach (var equippedItem in Equipment)
// foreach (var group in equippedItem.BehaviorGroups.Values)
// foreach(var behavior in group.Behaviors)
// if (behavior is T t)
// {
// var s = group.GetExposed<Trigger>();
// if (s != null) yield return (t, s);
// }
// }
//
// public IEnumerable<(T behavior, Axis axis)> GetAxis<T>() where T : class, IBehavior
// {
// foreach (var equippedItem in Equipment)
// foreach (var group in equippedItem.BehaviorGroups.Values)
// foreach(var behavior in group.Behaviors)
// if (behavior is T t)
// {
// var s = group.GetExposed<Axis>();
// if (s != null) yield return (t, s);
// }
// }
public virtual void Update(float delta)
{
var hullData = ItemManager.GetData(Hull) as HullData;

View file

@ -307,21 +307,7 @@ public abstract class ItemData : DatabaseEntry, INamedEntry
[DatabaseCategory("Items"), Inspectable, MessagePackObject]
public class SimpleCommodityData : ItemData
{
// // Types of body where this resource can be found
// [InspectableField, JsonProperty("resourceBodyType"), Key(6)]
// public BodyType ResourceBodyType;
//
// // Link to map(s) controlling density of resource, multiplied together when more than one
// [InspectableDatabaseLink(typeof(GalaxyMapLayerData)), JsonProperty("resourceDensity"), Key(7)]
// public List<Guid> ResourceDensity = new List<Guid>();
//
// // Controls the lowest value in the resource distribution curve
// [InspectableField, JsonProperty("distribution"), Key(8)]
// public ExponentialLerp Distribution;
//
// // Minimum amount of resources needed for presence to register
// [InspectableField, JsonProperty("floor"), Key(11)]
// public float Floor = 5f;
// MessagePack keys 6, 7, 8 and 11 belonged to removed resource-distribution fields; do not reuse them.
[Inspectable, JsonProperty("maxStackSize"), Key(9)]
public int MaxStack = 10;

View file

@ -59,54 +59,6 @@ public class ItemManager
_logger(s);
}
// public void Update()
// {
// foreach(var zone in _zones.Values)
// zone.Update((float) Time, _deltaTime);
//
// foreach (var corporation in Cache.GetAll<Corporation>())
// {
// foreach (var tasks in corporation.Tasks
// .Select(id => Cache.Get<AgentTask>(id)) // Fetch the tasks from the database cache
// .Where(task => !task.Reserved) // Filter out tasks that have already been reserved
// .GroupBy(task => task.Type)) // Group tasks by type
// {
// // Create a list of available controllers for this task type
// var availableControllers = CorporationControllers[corporation.ID]
// .Where(controller => controller.Available && controller.TaskType == tasks.Key).ToList();
//
// // Iterate over the highest priority tasks for which controllers are available
// foreach (var task in tasks.OrderByDescending(task => task.Priority).Take(availableControllers.Count))
// {
// // Find the nearest controller for this task
// IController nearestController = availableControllers[0];
// List<ZoneDefinition> nearestControllerPath = FindPath(GalaxyZones[availableControllers.First().Zone.Data.ID], GalaxyZones[task.Zone], true);
// foreach (var controller in availableControllers.Skip(1))
// {
// var path = FindPath(GalaxyZones[controller.Zone.Data.ID], GalaxyZones[task.Zone], true);
// if (path.Count < nearestControllerPath.Count)
// {
// nearestControllerPath = path;
// nearestController = controller;
// }
// }
// task.Reserved = true;
// nearestController.AssignTask(task.ID);
// }
// }
// }
//
// }
// public int ItemTier(CraftedItemData itemData)
// {
// if (Tier.ContainsKey(itemData)) return Tier[itemData];
//
// Tier[itemData] = itemData.Ingredients.Keys.Max(ci => _cache.Get<ItemData>(ci) is CraftedItemData craftableIngredient ? ItemTier(craftableIngredient) : 0);
//
// return Tier[itemData];
// }
public SimpleCommodityData GetData(SimpleCommodity item)
{
return item.Data.Value as SimpleCommodityData;

View file

@ -30,18 +30,6 @@ public class LoadoutGenerator
Faction = faction;
PriceExponent = priceExponent;
}
//
// public LoadoutGenerator(
// ref Random random,
// ItemManager itemManager,
// Faction faction,
// float priceExponent)
// {
// Random = random;
// ItemManager = itemManager;
// Faction = faction;
// PriceExponent = priceExponent;
// }
public EntityPack GenerateShipLoadout(Predicate<HullData> hullFilter = null)
{

View file

@ -106,20 +106,6 @@ public class StoryProcessor : IZoneResolver, IFactionResolver
// If the story has already been read / compiled, return it directly
if (_processedStories.ContainsKey(fileName)) return _processedStories[fileName];
// var compiledFileName = Path.Combine(inkFile.Directory.FullName, $"{fileName}.json");
//
// // Calculate a hash of the ink file
// var hash = File.ReadAllBytes(inkFile.FullName).GetHashSHA1();
//
// if (File.Exists(compiledFileName) && // If a compiled version of the ink file exists
// Settings.HashedStoryFiles.ContainsKey(fileName) && // And its hash has been saved
// hash == Settings.HashedStoryFiles[fileName]) // And the saved hash matches the current hash
// {
// // Load the story from the existing compiled JSON representation
// return new Story(File.ReadAllText(compiledFileName));
// }
//
// Settings.HashedStoryFiles[fileName] = hash;
var compiler = new Compiler(File.ReadAllText(inkFile.FullName), new Compiler.Options
{
countAllVisits = true,

View file

@ -54,24 +54,6 @@ public static class WeightedSampleElimination
DoEliminate( inputPoints, outputPoints, d_max, weightFunction, densityFunction );
}
// public static void Eliminate(
// float2[] inputPoints,
// float2[] outputPoints,
// float d_max = 0,
// float alpha = 8,
// float beta = 0.65f,
// float gamma = 1.5f)
// {
// if ( d_max < .001f ) d_max = 2 * GetMaxPoissonDiskRadius( outputPoints.Length );
// float d_min = d_max * GetWeightLimitFraction( inputPoints.Length, outputPoints.Length, beta, gamma );
// Eliminate( inputPoints, outputPoints, (p0, p1, d2, dmax, density) =>
// {
// float d = sqrt(d2);
// if ( d < d_min ) d = d_min;
// return pow( 1f / (d / dmax + .01f), alpha );
// }, v => 1, d_max);
// }
public static void Eliminate(
float2[] inputPoints,
float2[] outputPoints,

View file

@ -37,38 +37,6 @@ public class ZonePack
}
// [DatabaseCategory("Galaxy"), MessagePackObject, JsonObject(MemberSerialization.OptIn)]
// public class StationData : DatabaseEntry, INamedEntry
// {
// [JsonProperty("name"), Key(1)]
// public string Name;
//
// // Can be Planet or Orbit
// [JsonProperty("parent"), Key(2)]
// public Guid Parent;
//
// [JsonProperty("owner"), Key(3)]
// public Guid Owner;
//
// [JsonProperty("inventory"), Key(4)]
// public List<ItemInstance> Inventory = new List<ItemInstance>();
//
// [JsonProperty("buying"), Key(5)]
// public Dictionary<Guid, float> BuyPrices = new Dictionary<Guid, float>();
//
// [JsonProperty("selling"), Key(6)]
// public Dictionary<Guid, float> SellPrices = new Dictionary<Guid, float>();
//
// [JsonProperty("zone"), Key(7)]
// public Guid Zone;
//
// [IgnoreMember] public string EntryName
// {
// get => Name;
// set => Name = value;
// }
// }
[MessagePackObject,
JsonObject(MemberSerialization.OptIn),
Union(0, typeof(PlanetData)),