27 lines
993 B
C#
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);
|
|
}
|
|
}
|
|
} |