fixed basic movement, now add world loading
This commit is contained in:
parent
34ba37312a
commit
50f37ebc5f
23 changed files with 482 additions and 27 deletions
15
scripts/world/WorldIndex.cs
Normal file
15
scripts/world/WorldIndex.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Text.Json;
|
||||
|
||||
public record WorldIndex(int schema, string world_id, string display_name, int chunk_size_px, int tile_size_px, int[] start_pos_px, List<WorldIndexChunk> chunks)
|
||||
{
|
||||
public Dictionary<(int x, int y), string> BuildChunkMap()
|
||||
{
|
||||
var map = new Dictionary<(int, int), string>();
|
||||
foreach (var c in chunks)
|
||||
map[(c.x, c.y)] = c.path;
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
public record WorldIndexChunk(int x, int y, string path);
|
||||
Loading…
Add table
Add a link
Reference in a new issue