riversong code showcase

This commit is contained in:
Daniele Marotta
2026-05-21 15:52:18 +02:00
commit 4c9eea1c02
462 changed files with 23406 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
using System;
using Unity.Mathematics;
using UnityEngine;
using IServiceProvider = DanieleMarotta.RiversongCodeShowcase.IServiceProvider;
namespace DanieleMarotta.RiversongCodeShowcase
{
[GameSystemGroup(typeof(WorldGenSystemGroup))]
public class WorldCreationSystem : GameSystem, IServiceProvider, IDisposable
{
private World _world;
public WorldCreationSystem(IServiceLocator serviceLocator) : base(serviceLocator)
{
}
public void RegisterServices(IServiceLocator serviceLocator)
{
_world = new World();
_world.Size = int2.zero;
_world.Heightmap = new WorldHeightmap(int2.zero);
_world.BlockMap = new BlockMap(int2.zero);
_world.Fertility = new FertilityMap(int2.zero);
_world.WaterMap = new WaterMap(int2.zero);
_world.EntityIdMap = new EntityIdMap(int2.zero);
_world.RoadNetwork = new RoadNetwork(int2.zero);
ServiceLocator.RegisterService(_world);
}
public void Dispose()
{
_world.Dispose();
Debug.Log("World disposed");
}
}
}