Initial work

This commit is contained in:
miku-666
2025-11-09 09:48:13 +01:00
parent 28413912b4
commit 39b1df7c6d
20 changed files with 765 additions and 70 deletions

47
PckStudio.Core/MapData.cs Normal file
View File

@@ -0,0 +1,47 @@
using System.Drawing;
using OMI.Formats.GameRule;
namespace PckStudio.Core
{
public enum MiniGameId : int
{
None,
Battle,
Tumble,
Glide
}
public enum MapSize : int
{
Small,
Large,
Huge
}
public class MapData
{
public string Name { get; }
public Image Thumbnail { get; }
public GameRuleFile Grf { get; }
public NamedData<byte[]> World { get; }
public MapData(string name, Image thumbnail, MiniGameId miniGame, MapSize mapSize, NamedData<byte[]> world)
{
Name = name;
Thumbnail = thumbnail;
Grf = new GameRuleFile();
Grf.AddRule("MapOptions",
new GameRuleFile.IntParameter("seed", 0),
new GameRuleFile.IntParameter("spawnX", 0),
new GameRuleFile.IntParameter("spawnY", 0),
new GameRuleFile.IntParameter("spawnZ", 0),
new GameRuleFile.BoolParameter("flatworld", false),
new GameRuleFile.IntParameter("mapSize", (int)mapSize),
new GameRuleFile.IntParameter("themeId", 0)
);
Grf.AddRule("LevelRules", [new GameRuleFile.IntParameter("ruleType", (int)miniGame)]);
World = world;
}
}
}