Beispiel #1
0
 internal PlayerPlacingBlockEventArgs([NotNull] Player player, [NotNull] Map map, Vector3I coords,
                                      Block oldBlock, Block newBlock, BlockChangeContext context,
                                      CanPlaceResult result)
 {
     if (map == null)
     {
         throw new ArgumentNullException("map");
     }
     Player   = player;
     Map      = map;
     Coords   = coords;
     OldBlock = oldBlock;
     NewBlock = newBlock;
     Context  = context;
     Result   = result;
 }
Beispiel #2
0
 internal PlayerPlacingBlockEventArgs([NotNull] Player player, [NotNull] Map map, Vector3I coords,
                                      Block oldBlock, Block newBlock, BlockChangeContext context, CanPlaceResult result)
     : base(player, map, coords, oldBlock, newBlock, context)
 {
     Result = result;
 }
Beispiel #3
0
 internal PlayerPlacingBlockEventArgs( [NotNull] Player player, [NotNull] Map map, Vector3I coords,
                                       Block oldBlock, Block newBlock, BlockChangeContext context,
                                       CanPlaceResult result ) {
     if( map == null ) throw new ArgumentNullException( "map" );
     Player = player;
     Map = map;
     Coords = coords;
     OldBlock = oldBlock;
     NewBlock = newBlock;
     Context = context;
     Result = result;
 }
Beispiel #4
0
 internal PlayerPlacingBlockEventArgs( Player player, short x, short y, short h, Block oldBlock, Block newBlock, bool isManual, CanPlaceResult result )
     : base( player, x, y, h, oldBlock, newBlock, isManual ) {
     Result = result;
 }
Beispiel #5
0
 internal PlayerPlacingBlockEventArgs( [NotNull] Player player, [NotNull] Map map, Vector3I coords,
                                       Block oldBlock, Block newBlock, BlockChangeContext context, CanPlaceResult result )
     : base( player, map, coords, oldBlock, newBlock, context ) {
     Result = result;
 }
Beispiel #6
0
 internal static CanPlaceResult RaisePlayerPlacingBlockEvent( Player player, short x, short y, short h, Block oldBlock, Block newBlock, bool manual, CanPlaceResult result ) {
     var handler = PlayerPlacingBlock;
     if( handler == null ) return result;
     var e = new PlayerPlacingBlockEventArgs( player, x, y, h, oldBlock, newBlock, manual, result );
     handler( null, e );
     return e.Result;
 }
Beispiel #7
0
 internal PlayerPlacingBlockEventArgs(Player player, short x, short y, short h, Block oldBlock, Block newBlock, bool isManual, CanPlaceResult result)
     : base(player, x, y, h, oldBlock, newBlock, isManual)
 {
     Result = result;
 }
Beispiel #8
0
        internal static CanPlaceResult RaisePlayerPlacingBlockEvent(Player player, short x, short y, short h, Block oldBlock, Block newBlock, bool manual, CanPlaceResult result)
        {
            var handler = PlayerPlacingBlock;

            if (handler == null)
            {
                return(result);
            }
            var e = new PlayerPlacingBlockEventArgs(player, x, y, h, oldBlock, newBlock, manual, result);

            handler(null, e);
            return(e.Result);
        }