using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Unity.Mathematics; namespace GamecraftModdingAPI.Blocks { /// /// Common block movement operations /// public static class Rotation { private static RotationEngine rotationEngine = new RotationEngine(); /// /// Rotate a single block by a specific amount in degrees /// /// The block's id /// The rotation amount around the x,y,z-axis /// Whether the operation was successful public static bool RotateBlock(uint id, float3 vector) { if (rotationEngine.IsInGame && rotationEngine.IsBuildMode()) { rotationEngine.RotateBlock(id, vector); return true; } return false; } /// /// Rotate all connected blocks by a specific amount in degrees /// /// The starting block's id /// The rotation around the x,y,z-axis /// Whether the operation was successful public static bool RotateConnectedBlocks(uint id, float3 vector) { if (rotationEngine.IsInGame && rotationEngine.IsBuildMode()) { rotationEngine.RotateConnectedBlocks(id, vector); return true; } return false; } public static void Init() { GamecraftModdingAPI.Utility.GameEngineManager.AddGameEngine(rotationEngine); } } }