diff --git a/Assets/Scripts/Gameplay/ActionGameManager.cs b/Assets/Scripts/Gameplay/ActionGameManager.cs index 762a185fd..cffa5ab59 100644 --- a/Assets/Scripts/Gameplay/ActionGameManager.cs +++ b/Assets/Scripts/Gameplay/ActionGameManager.cs @@ -550,48 +550,6 @@ public class ActionGameManager : MonoBehaviour }); //Temporary, or not ConsoleController.AddCommand("tow", _ => TowShip()); - - // ConsoleController.AddCommand("pingscene", - // _ => - // { - // var startTime = Time.time; - // Observable.EveryUpdate().TakeWhile(_ => Time.time - startTime < 5).Subscribe( - // _ => Debug.Log($"{(int) (Time.time - startTime)}"), - // () => - // { - // var nearestFaction = CurrentSector.Factions.MinBy(f => CurrentSector.HomeZones[f].Distance[Zone.SectorZone]); - // var nearestFactionHomeZone = CurrentSector.HomeZones[nearestFaction]; - // var factionPresence = nearestFaction.InfluenceDistance - nearestFactionHomeZone.Distance[Zone.SectorZone] + 1; - // - // var loadoutGenerator = new LoadoutGenerator( - // ref ItemManager.Random, - // ItemManager, - // CurrentSector, - // Zone.SectorZone, - // nearestFaction, - // .5f); - // - // for (int i = 0; i < 8; i++) - // { - // var ship = EntitySerializer.Unpack(ItemManager, Zone, loadoutGenerator.GenerateShipLoadout(), true); - // ship.Position.xz = _currentEntity.Position.xz + - // ItemManager.Random.NextFloat2Direction() * ItemManager.Random.NextFloat(50, 500); - // ship.Zone = Zone; - // Zone.Entities.Add(ship); - // ship.Activate(); - // } - // - // for (int i = 0; i < 8; i++) - // { - // var turret = EntitySerializer.Unpack(ItemManager, Zone, loadoutGenerator.GenerateTurretLoadout(), true); - // turret.Position.xz = _currentEntity.Position.xz + - // ItemManager.Random.NextFloat2Direction() * ItemManager.Random.NextFloat(50, 500); - // turret.Zone = Zone; - // Zone.Entities.Add(turret); - // turret.Activate(); - // } - // }); - // }); } public void BeginDrag(DragObject dragObject) diff --git a/Assets/Scripts/ServerShared/CultCache/CultCache.cs b/Assets/Scripts/ServerShared/CultCache/CultCache.cs index 612e28a71..b2cd294e8 100644 --- a/Assets/Scripts/ServerShared/CultCache/CultCache.cs +++ b/Assets/Scripts/ServerShared/CultCache/CultCache.cs @@ -35,21 +35,6 @@ public class CultCache private readonly Dictionary _globals = new Dictionary(); private readonly Dictionary> _types = new Dictionary>(); - // private readonly Dictionary entries)> _externalTypes = new Dictionary entries)>(); - - // private class ExternalEntry - // { - // public string FilePath; - // public DatabaseEntry Entry; - // - // public ExternalEntry(string filePath, DatabaseEntry entry) - // { - // FilePath = filePath; - // Entry = entry; - // } - // } - // private readonly Dictionary _externalEntries = new Dictionary(); - public IEnumerable AllEntries => _entries.Values; public CultCache() diff --git a/Assets/Scripts/ServerShared/Entity.cs b/Assets/Scripts/ServerShared/Entity.cs index 64133c42d..439ebf7b2 100644 --- a/Assets/Scripts/ServerShared/Entity.cs +++ b/Assets/Scripts/ServerShared/Entity.cs @@ -845,42 +845,6 @@ public abstract class Entity yield return b; } - // public IEnumerable<(T t, Switch s)> GetSwitch() 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(); - // if (s != null) yield return (t, s); - // } - // } - // - // public IEnumerable<(T behavior, Trigger trigger)> GetTrigger() 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(); - // if (s != null) yield return (t, s); - // } - // } - // - // public IEnumerable<(T behavior, Axis axis)> GetAxis() 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(); - // if (s != null) yield return (t, s); - // } - // } - public virtual void Update(float delta) { var hullData = ItemManager.GetData(Hull) as HullData; diff --git a/Assets/Scripts/ServerShared/ItemData.cs b/Assets/Scripts/ServerShared/ItemData.cs index 010eaaf1d..5425cf100 100644 --- a/Assets/Scripts/ServerShared/ItemData.cs +++ b/Assets/Scripts/ServerShared/ItemData.cs @@ -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 ResourceDensity = new List(); - // - // // 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; diff --git a/Assets/Scripts/ServerShared/ItemManager.cs b/Assets/Scripts/ServerShared/ItemManager.cs index c845d238b..e0f78875b 100644 --- a/Assets/Scripts/ServerShared/ItemManager.cs +++ b/Assets/Scripts/ServerShared/ItemManager.cs @@ -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()) - // { - // foreach (var tasks in corporation.Tasks - // .Select(id => Cache.Get(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 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(ci) is CraftedItemData craftableIngredient ? ItemTier(craftableIngredient) : 0); - // - // return Tier[itemData]; - // } - public SimpleCommodityData GetData(SimpleCommodity item) { return item.Data.Value as SimpleCommodityData; diff --git a/Assets/Scripts/ServerShared/LoadoutGenerator.cs b/Assets/Scripts/ServerShared/LoadoutGenerator.cs index cab72975c..ce43d2865 100644 --- a/Assets/Scripts/ServerShared/LoadoutGenerator.cs +++ b/Assets/Scripts/ServerShared/LoadoutGenerator.cs @@ -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 hullFilter = null) { diff --git a/Assets/Scripts/ServerShared/Narrative/StoryProcessor.cs b/Assets/Scripts/ServerShared/Narrative/StoryProcessor.cs index 21b13a53d..794ee3ea3 100644 --- a/Assets/Scripts/ServerShared/Narrative/StoryProcessor.cs +++ b/Assets/Scripts/ServerShared/Narrative/StoryProcessor.cs @@ -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, diff --git a/Assets/Scripts/ServerShared/SampleElimination.cs b/Assets/Scripts/ServerShared/SampleElimination.cs index 4827bd248..0c335c13a 100644 --- a/Assets/Scripts/ServerShared/SampleElimination.cs +++ b/Assets/Scripts/ServerShared/SampleElimination.cs @@ -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, diff --git a/Assets/Scripts/ServerShared/ZoneData.cs b/Assets/Scripts/ServerShared/ZoneData.cs index 35633b422..d5264946e 100644 --- a/Assets/Scripts/ServerShared/ZoneData.cs +++ b/Assets/Scripts/ServerShared/ZoneData.cs @@ -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 Inventory = new List(); -// -// [JsonProperty("buying"), Key(5)] -// public Dictionary BuyPrices = new Dictionary(); -// -// [JsonProperty("selling"), Key(6)] -// public Dictionary SellPrices = new Dictionary(); -// -// [JsonProperty("zone"), Key(7)] -// public Guid Zone; -// -// [IgnoreMember] public string EntryName -// { -// get => Name; -// set => Name = value; -// } -// } - [MessagePackObject, JsonObject(MemberSerialization.OptIn), Union(0, typeof(PlanetData)), diff --git a/Assets/Scripts/UI/Menu/InventoryMenu.cs b/Assets/Scripts/UI/Menu/InventoryMenu.cs index 3d7f60bdd..48f2bed3f 100644 --- a/Assets/Scripts/UI/Menu/InventoryMenu.cs +++ b/Assets/Scripts/UI/Menu/InventoryMenu.cs @@ -28,24 +28,6 @@ public class InventoryMenu : MonoBehaviour private InventoryPanel _selectedPanel; private ItemInstance _selectedItem; private ItemData _selectedItemData; - // private List _backgroundSubscriptions; - - // private ItemInstance _dragItem; - // private Transform[] _dragCells; - // private Vector2[] _dragOffsets; - // private int2 _dragCellOffset; - // private ItemRotation _originalRotation; - // //private Shape _previousFakeOccupancy; - // private Shape _originalOccupancy; - // private EquippedItem _originalEquippedItem; - // private InventoryPanel _originalPanel; - // - // private InventoryPanel _dragTargetPanel; - // private int2 _dragTargetPosition; - // private int2 _lastDragPosition; - // private bool _dragTargetValid; - // private bool _destroyItem; - private void OnEnable() { // Background.gameObject.SetActive(true); diff --git a/Assets/Scripts/UI/Menu/SectorRenderer.cs b/Assets/Scripts/UI/Menu/SectorRenderer.cs index ad27b9a8d..a5d61461c 100644 --- a/Assets/Scripts/UI/Menu/SectorRenderer.cs +++ b/Assets/Scripts/UI/Menu/SectorRenderer.cs @@ -105,41 +105,7 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS Properties.AddProperty("Ships", () => shipCount); } }); - - // PathAnimationButton.onClick.AddListener(() => - // { - // Map.StartCoroutine(AnimatePath()); - // }); } - - // private IEnumerator AnimatePath() - // { - // var pathZones = ActionGameManager.CurrentSector.ExitPath; - // LegendPanel.SetActive(false); - // PathAnimationButton.gameObject.SetActive(false); - // - // var revealCount = ActionGameManager.CurrentSector.Entrance.Distance[ActionGameManager.CurrentSector.Exit]; - // Map.StartReveal( - // PathAnimationDuration / revealCount * (LinkAnimationDuration / (IconAnimationDuration + LinkAnimationDuration)), - // PathAnimationDuration / revealCount * (IconAnimationDuration / (IconAnimationDuration + LinkAnimationDuration))); - // MainCamera.enabled = false; - // SectorCamera.targetTexture = null; - // Canvas.gameObject.SetActive(false); - // SectorCamera.gameObject.SetActive(true); - // - // var pathAnimationLerp = 0f; - // while (pathAnimationLerp < 1) - // { - // var currentTargetZone = pathZones[(int) (pathZones.Length * pathAnimationLerp)]; - // _position = lerp(_position, currentTargetZone.Position, PathAnimationDamping); - // pathAnimationLerp += Time.deltaTime / (PathAnimationDuration * PathAnimationDurationPadding); - // UpdateCamera(); - // yield return null; - // } - // - // LegendPanel.SetActive(true); - // PathAnimationButton.gameObject.SetActive(true); - // } private void OnEnable() { diff --git a/Assets/Scripts/UI/Menu/Spreadsheet.cs b/Assets/Scripts/UI/Menu/Spreadsheet.cs index 8a6d9beee..3eb3e29c4 100644 --- a/Assets/Scripts/UI/Menu/Spreadsheet.cs +++ b/Assets/Scripts/UI/Menu/Spreadsheet.cs @@ -157,27 +157,6 @@ public class Spreadsheet : MonoBehaviour row.ApplyColumnSizes(_columnSizes); } - void Start() - { - // ShowData( - // new []{"Column 1", "Column 2", "Column 3", "Column 4", "Column 5"}, - // new []{2,1,1,1,1}, - // Enumerable.Range(0,10) - // .Select(i=>new SpreadsheetEntryRow - // { - // Columns = Enumerable.Range(0,5).Select(j=> - // { - // var value = Random.Range(0, 10000); - // return new SpreadsheetEntryColumn - // { - // Output = () => $"c{(j+1).ToString()}:{value.ToString()}", - // SortKey = value - // }; - // }).ToArray() - // }).ToArray() - // ); - } - void Update() { diff --git a/Assets/Scripts/UI/Properties Panel/PropertiesList.cs b/Assets/Scripts/UI/Properties Panel/PropertiesList.cs index f3d6fc9ba..cbde8db40 100644 --- a/Assets/Scripts/UI/Properties Panel/PropertiesList.cs +++ b/Assets/Scripts/UI/Properties Panel/PropertiesList.cs @@ -58,32 +58,4 @@ public class PropertiesList : PropertiesPanel } OnExpand?.Invoke(_expanded); } - - // public override PropertyLabel AddProperty(string name, Func read = null, Action onClick = null, bool radio = false) - // { - // var prop = base.AddProperty(name, read, onClick, radio); - // prop.gameObject.SetActive(false); - // return prop; - // } - // - // public override PropertiesList AddList(string name) - // { - // var list = base.AddList(name); - // list.gameObject.SetActive(false); - // return list; - // } - // - // public override RectTransform AddSection(string name) - // { - // var section = base.AddSection(name); - // section.gameObject.SetActive(false); - // return section; - // } - // - // public override PropertyButton AddButton(string name, Action onClick) - // { - // var button = base.AddButton(name, onClick); - // button.gameObject.SetActive(false); - // return button; - // } } diff --git a/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs b/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs index 54c14f617..75e37f58a 100644 --- a/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs +++ b/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs @@ -357,29 +357,6 @@ public class PropertiesPanel : MonoBehaviour OnPropertyAdded?.Invoke(field.gameObject); } - // public void Inspect(Entity entity) - // { - // Clear(); - // Title.text = entity.Name; - // var hullData = Context.GetData(entity.Hull) as HullData; - // AddSection( - // hullData.HullType == HullType.Ship ? "Ship" : - // hullData.HullType == HullType.Station ? "Station" : - // "Platform"); - // //AddList(hullData.Name).Inspect(hull, entity); - // //PropertiesPanel.AddProperty("Hull", () => $"{hullData.Name}"); - // AddEntityProperties(entity); - // //cargoList.SetExpanded(false,true); - // - // RefreshValues(); - // } - - // private void AddEntityProperties(Entity entity) - // { - // AddField("Name", () => entity.Name, name => entity.Name = name); - // AddProperty("Mass", () => $"{entity.Mass.SignificantDigits(Context.GameplaySettings.SignificantDigits)}"); - // } - private void AddItemProperties(ItemInstance item) { var data = item.Data.Value; diff --git a/Assets/Scripts/Zone Display/ZoneRenderer.cs b/Assets/Scripts/Zone Display/ZoneRenderer.cs index 86d617cf9..781d669be 100644 --- a/Assets/Scripts/Zone Display/ZoneRenderer.cs +++ b/Assets/Scripts/Zone Display/ZoneRenderer.cs @@ -421,31 +421,6 @@ public class ZoneRenderer : MonoBehaviour LODHandler.FindPlanets(); } - // private void Update() - // { - // if (Tour) - // { - // _tourTimer -= UnityEngine.Time.deltaTime; - // if (_tourTimer < 0) - // { - // _tourTimer = TourSwitchTime; - // _tourIndex = (_tourIndex + 1) % _tourPlanets.Count; - // SceneCamera.Follow = _tourPlanets[_tourIndex].Item1; - // SceneCamera.LookAt = _tourPlanets[_tourIndex].Item2; - // if(_tourIndex==0) Debug.Log("Tour Complete!"); - // } - // // if(_tourIndex>=0) - // // { - // // var offset = (SceneCamera.Follow.position - SceneCamera.LookAt.position); - // // offset.y = 0; - // // offset = offset.normalized * TourFollowDistance; - // // offset.y = TourHeightOffset; - // // offset = Quaternion.AngleAxis(TourFollowOffsetDegrees, Vector3.up) * offset; - // // _transposer.m_FollowOffset = offset; - // // } - // } - // } - void Update() { var maxDepth = 0f;