MSAGL Support

Added new tech tree layout implementation using Microsoft Automatic Graph Layouts
Added some functionality to the database editor tools
This commit is contained in:
hyperion51 2020-04-14 00:42:04 +01:00
commit 01a956eef6
1110 changed files with 119054 additions and 151 deletions

View file

@ -12,7 +12,7 @@ public class BlueprintData : DatabaseEntry, INamedEntry
[InspectableField, JsonProperty("name"), Key(1)]
public string Name;
[InspectableField, JsonProperty("ingredients"), Key(2)]
[InspectableDatabaseLink(typeof(ItemData)), JsonProperty("ingredients"), Key(2)]
public Dictionary<Guid, int> Ingredients = new Dictionary<Guid, int>();
[InspectableDatabaseLink(typeof(CraftedItemData)), JsonProperty("item"), Key(3)]
@ -22,10 +22,19 @@ public class BlueprintData : DatabaseEntry, INamedEntry
public int Quantity;
[InspectableField, JsonProperty("difficulty"), Key(5)]
public int Difficulty;
public float Difficulty;
[InspectableField, JsonProperty("statEffects"), Key(6)]
[InspectableField, JsonProperty("quality"), Key(6)]
public float Quality;
[InspectableField, JsonProperty("statEffects"), Key(7)]
public List<BlueprintStatEffect> StatEffects = new List<BlueprintStatEffect>();
[InspectableField, JsonProperty("researchTime"), Key(8)]
public float ResearchTime;
[InspectableDatabaseLink(typeof(BlueprintData)), JsonProperty("researchDependencies"), Key(9)]
public Dictionary<Guid, int> Dependencies = new Dictionary<Guid, int>();
[IgnoreMember] public string EntryName
{

View file

@ -69,7 +69,7 @@ public static class Extensions
private static Random? _random;
private static Random Random => (Random) (_random ?? (_random = new Random(1337)));
//public static T RandomElement<T>(this IEnumerable<T> enumerable) => enumerable.ElementAt(Random.NextInt(0, enumerable.Count()));
public static T RandomElement<T>(this IEnumerable<T> enumerable) => enumerable.ElementAt(Random.NextInt(0, enumerable.Count()));
public static float NextUnbounded(this Random random) => 1 / (1 - random.NextFloat()) - 1;
public static float NextUnbounded(this Random random, float bias, float power) => 1 / (1 - pow(random.NextFloat(), 1 - pow(clamp(bias,0,.99f), 1 / power))) - 1;

View file

@ -1,16 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using JsonKnownTypes;
using MessagePack;
using Newtonsoft.Json;
using Unity.Mathematics;
using static Unity.Mathematics.math;
using static Unity.Mathematics.noise;
[RethinkTable("Items"), Inspectable, MessagePackObject, JsonObject(MemberSerialization.OptIn)]
public class Technology
{
}

View file

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 32fff9332ceb4fa087d8987c1f9e838a
timeCreated: 1586562126