mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-07-15 08:08:51 +00:00
Initial work
This commit is contained in:
47
PckStudio.Core/MapData.cs
Normal file
47
PckStudio.Core/MapData.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user