Files
QuartZ-dump/GlobalShared/Events/BlockEvents.cs
2024-12-29 21:15:58 +01:00

27 lines
993 B
C#

using System;
using Sandbox.Definitions;
using Sandbox.Game.Entities;
using VRageMath;
namespace Global.Shared.Events
{
public class BlockEvents
{
public delegate void CanPlaceBlockDelegate(MyCubeGrid grid, MyBlockOrientation? orientation,
MyCubeBlockDefinition blockDefinition, ulong placingPlayer, ref bool canPlace);
public static Action<IMyControllableEntity> OnPlayerControlAcquired;
public static Action<IMyControllableEntity> OnPlayerControlReleased;
public static Action<MyCubeBlock> OnBlockAdded;
public static Action<MyCubeBlock> OnBlockRemoved;
public static event CanPlaceBlockDelegate CanPlaceBlockEvent;
internal static void OnCanPlaceBlockEvent(MyCubeGrid grid, MyBlockOrientation? orientation,
MyCubeBlockDefinition def, ulong placingPlayer, ref bool canPlace)
{
CanPlaceBlockEvent?.Invoke(grid, orientation, def, placingPlayer, ref canPlace);
}
}
}