68 lines
1.7 KiB
C#
68 lines
1.7 KiB
C#
using System;
|
|
using Unity.Mathematics;
|
|
|
|
namespace DanieleMarotta.RiversongCodeShowcase
|
|
{
|
|
public class World : IDisposable
|
|
{
|
|
public int Seed { get; set; }
|
|
|
|
public int2 Size { get; set; }
|
|
|
|
public WorldHeightmap Heightmap { get; set; }
|
|
|
|
public BlockMap BlockMap { get; set; }
|
|
|
|
public FertilityMap Fertility { get; set; }
|
|
|
|
public WaterMap WaterMap { get; set; }
|
|
|
|
public RawResourcesState RawResources { get; } = new();
|
|
|
|
public ProductStacksState ProductStacks { get; } = new();
|
|
|
|
public EntityIdMap EntityIdMap { get; set; }
|
|
|
|
public RoadNetwork RoadNetwork { get; set; }
|
|
|
|
public WorldTimeState TimeState { get; } = new();
|
|
|
|
public WorldAgentsState AgentsState { get; } = new();
|
|
|
|
public WorldCritterHerdsState CritterHerdsState { get; } = new();
|
|
|
|
public WorldProductionState ProductionState { get; } = new();
|
|
|
|
public UnlocksState UnlocksState { get; } = new();
|
|
|
|
public WorldPopulationState PopulationState { get; } = new();
|
|
|
|
public OnboardingState OnboardingState { get; } = new();
|
|
|
|
public bool Contains(int2 p)
|
|
{
|
|
return p.x >= 0 && p.x < Size.x && p.y >= 0 && p.y < Size.y;
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
Heightmap?.Dispose();
|
|
Heightmap = null;
|
|
|
|
BlockMap?.Dispose();
|
|
BlockMap = null;
|
|
|
|
Fertility?.Dispose();
|
|
Fertility = null;
|
|
|
|
WaterMap?.Dispose();
|
|
WaterMap = null;
|
|
|
|
EntityIdMap?.Dispose();
|
|
EntityIdMap = null;
|
|
|
|
RoadNetwork?.Dispose();
|
|
RoadNetwork = null;
|
|
}
|
|
}
|
|
} |