#How to store information as if it were a Dictionary<Key, Value>

1 messages · Page 1 of 1 (latest)

true chasm
#

My goal is to simulate basic Minecraft/Voxel just to introduce myself to ecs, but when checking the wiki I noticed that this point of easy access to block information without having to rely on a loop was not possible with my current knowledge
I would like to know what alternatives would be to easily access this information during execution since this data can be changed and this component was just an example.

    public struct ChunkData : IComponentData {
        public int3 Position { get; set; }
        public NativeHashMap<int3, X> Blocks { get; set; } // Not allowed
        public Dictionary<int3, X> Blocks { get; set; } // Not allowed
        public List<X> Blocks { get; set; } // I believe is going to be too expensive
        public DynamicBuffer<X> Blocks { get; set; } // I believe is going to be too expensive
    }
worthy shoal
#

which you might find interesting

#

which are basically just dynamicbuffers made to work like hashmaps

true chasm