Improved Blueprints Workflow
#35 Resolved, blueprints are now organized as foldouts on each item
This commit is contained in:
parent
feb24cfd6b
commit
5d674e9fe3
3 changed files with 144 additions and 26 deletions
|
|
@ -6,7 +6,7 @@ using Newtonsoft.Json;
|
|||
using Unity.Mathematics;
|
||||
using static Unity.Mathematics.math;
|
||||
|
||||
[RethinkTable("Items"), Inspectable, MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
||||
[RethinkTable("Items"), MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
||||
public class BlueprintData : DatabaseEntry, INamedEntry
|
||||
{
|
||||
[InspectableField, JsonProperty("name"), Key(1)]
|
||||
|
|
@ -15,7 +15,7 @@ public class BlueprintData : DatabaseEntry, INamedEntry
|
|||
[InspectableDatabaseLink(typeof(ItemData)), JsonProperty("ingredients"), Key(2)]
|
||||
public Dictionary<Guid, int> Ingredients = new Dictionary<Guid, int>();
|
||||
|
||||
[InspectableDatabaseLink(typeof(ItemData)), JsonProperty("item"), Key(3)]
|
||||
[JsonProperty("item"), Key(3)]
|
||||
public Guid Item;
|
||||
|
||||
[InspectableField, JsonProperty("quantity"), Key(4)]
|
||||
|
|
|
|||
|
|
@ -10,7 +10,9 @@ public class DatabaseCache
|
|||
public event Action<DatabaseEntry> OnDataInsertLocal;
|
||||
public event Action<DatabaseEntry> OnDataUpdateLocal;
|
||||
public event Action<DatabaseEntry> OnDataDeleteLocal;
|
||||
public event Action<DatabaseEntry> OnDataInsertRemote;
|
||||
public event Action<DatabaseEntry> OnDataUpdateRemote;
|
||||
public event Action<DatabaseEntry> OnDataDeleteRemote;
|
||||
|
||||
public Action<string> Logger = Console.WriteLine;
|
||||
|
||||
|
|
@ -36,7 +38,12 @@ public class DatabaseCache
|
|||
}
|
||||
|
||||
if (remote)
|
||||
OnDataUpdateRemote?.Invoke(entry);
|
||||
{
|
||||
if (exists)
|
||||
OnDataUpdateRemote?.Invoke(entry);
|
||||
else
|
||||
OnDataInsertRemote?.Invoke(entry);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (exists)
|
||||
|
|
@ -84,7 +91,9 @@ public class DatabaseCache
|
|||
type.Remove(entry.ID);
|
||||
}
|
||||
|
||||
if (!remote)
|
||||
if (remote)
|
||||
OnDataDeleteRemote?.Invoke(entry);
|
||||
else
|
||||
OnDataDeleteLocal?.Invoke(entry);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue