Added Arch Persitance and Relationships, styackable items, hot fixed Tags.containsAll. AutoList in Ordered!DList
This commit is contained in:
@@ -43,10 +43,12 @@ public class BacterialSystem : BaseSystem<World, float>
|
||||
|
||||
//Will Liklely be the game instead of a node like this
|
||||
[Meta(typeof(IAutoNode))]// [Tool]
|
||||
public partial class VoxelGridNode : Node3D, IProvide<IVoxelGridRegistry>, IProvide<IItemRenderer>, IProvide<IRecipes>, IProvide<IBlueprintManger>, IProvide<World>
|
||||
public partial class VoxelGridNode : Node3D, IProvide<IVoxelGridRegistry>, IProvide<IItemRenderer>, IProvide<IRecipes>, IProvide<IBlueprintManger>, IProvide<World>, IProvide<IFoodFactoryApi>
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
private IFoodFactoryApi _api = default!;
|
||||
IFoodFactoryApi IProvide<IFoodFactoryApi>.Value() => _api;
|
||||
private World _world = default!;
|
||||
World IProvide<World>.Value() => _world;
|
||||
private IVoxelGridRegistry _voxelGridRegistry = default!;
|
||||
@@ -63,24 +65,40 @@ public partial class VoxelGridNode : Node3D, IProvide<IVoxelGridRegistry>, IProv
|
||||
// GD.Print();
|
||||
base._Ready();
|
||||
_voxelGridRegistry = new VoxelRegistry();
|
||||
_itemRenderer = new ItemRenderSimple();
|
||||
_itemRenderer = new ItemRenderBuffered();
|
||||
_blueprintManger = new BlueprintManger();
|
||||
_recipes = new Recipes();
|
||||
_world = World.Create();
|
||||
_systems = new Group<float>("Items", new BacterialSystem(_world));
|
||||
var tickManger = new TickManger();
|
||||
|
||||
|
||||
AddChild(_itemRenderer as Node);
|
||||
Timer timer = new Timer() { WaitTime = .25f, Autostart = true };//TEST
|
||||
var delta = .2f;
|
||||
Timer timer = new Timer() { WaitTime = delta, Autostart = true };//TEST
|
||||
AddChild(timer);//TEST
|
||||
// timer.Timeout += _itemRenderer.Tick;//TEST
|
||||
_api = new FoodFactoryApi()
|
||||
{
|
||||
BlueprintManger = _blueprintManger,
|
||||
Recipes = _recipes,
|
||||
ItemRenderer = _itemRenderer,
|
||||
TickManger = tickManger,
|
||||
GridRegistry = _voxelGridRegistry
|
||||
};
|
||||
int tick = 0;
|
||||
timer.Timeout += () =>
|
||||
{
|
||||
_systems.BeforeUpdate(.25f);
|
||||
_systems.Update(.25f);
|
||||
_systems.AfterUpdate(.25f);
|
||||
_systems.BeforeUpdate(delta);
|
||||
_systems.Update(delta);
|
||||
_systems.AfterUpdate(delta);
|
||||
tickManger.BroadCast(new(tick, delta));
|
||||
tick++;
|
||||
|
||||
};
|
||||
_systems.Initialize();
|
||||
|
||||
|
||||
this.Provide();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user