mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-07-01 11:53:35 +00:00
Add AbstractGameRule.cs & derived classes
This commit is contained in:
41
PckStudio.Core/GameRule/DistributeItems.cs
Normal file
41
PckStudio.Core/GameRule/DistributeItems.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using OMI.Formats.GameRule;
|
||||
|
||||
namespace PckStudio.Core.GameRule
|
||||
{
|
||||
internal sealed class DistributeItems : AbstractGameRule
|
||||
{
|
||||
private static string[] _strings =
|
||||
{
|
||||
"StartItems",
|
||||
"OuterItems",
|
||||
"HVItems"
|
||||
};
|
||||
|
||||
internal enum DistributeItemsId
|
||||
{
|
||||
StartItems,
|
||||
OuterItems,
|
||||
HighValueItems
|
||||
}
|
||||
private DistributeItemsId _id;
|
||||
|
||||
internal void AddPosition(int x, int y, int z) => AddRule(new WorldPosition(x, y, z));
|
||||
|
||||
public DistributeItems(DistributeItemsId id)
|
||||
{
|
||||
_id = id;
|
||||
}
|
||||
|
||||
protected override GameRuleFile.GameRule GetGameRule()
|
||||
{
|
||||
var gameRule = new GameRuleFile.GameRule("DistributeItems");
|
||||
gameRule.AddParameter(new GameRuleFile.GameRuleParameter("id", _strings[(int)_id]));
|
||||
return gameRule;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user