Added Arch Persitance and Relationships, styackable items, hot fixed Tags.containsAll. AutoList in Ordered!DList

This commit is contained in:
2026-05-16 12:44:51 -04:00
parent bf4d856608
commit 75c93f0c43
40 changed files with 52609 additions and 197 deletions

View File

@@ -0,0 +1,50 @@
namespace FoodFactory;
using System;
using System.Collections.Generic;
using FoodFactory.Conveyors;
using FoodFactory.Recipes;
using FoodFactory.Voxel;
public interface IFoodFactoryApi
{
T? GetApi<T>() where T : class;
IRecipes Recipes { get; }
IBlueprintManger BlueprintManger { get; }
ITickManger TickManger { get; }
IItemRenderer ItemRenderer { get; }
IVoxelGridRegistry GridRegistry { get; }
}
public interface ITickManger
{
delegate void Tick(TickArgs args);
event Tick GameTick;
}
public record struct TickArgs(int Tick, double Delta);
public class TickManger : ITickManger
{
public event ITickManger.Tick? GameTick;
public void BroadCast(TickArgs args) => GameTick?.Invoke(args);
}
public class FoodFactoryApi : IFoodFactoryApi
{
public required IRecipes Recipes { get; set; }
public required IBlueprintManger BlueprintManger { get; set; }
public required ITickManger TickManger { get; set; }
public required IItemRenderer ItemRenderer { get; set; }
public required IVoxelGridRegistry GridRegistry { get; set; }
private readonly Dictionary<Type, object> _otherApi = [];
public T? GetApi<T>() where T : class
{
if (_otherApi.TryGetValue(typeof(T), out var api))
{
return api as T;
}
return null;
}
}

View File

@@ -0,0 +1 @@
uid://dbmq2c5nn8r1q