Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Add support for Array madness
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Apr 2, 2022
1 parent 792661f commit e1e7ba1
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
44 changes: 44 additions & 0 deletions JustArchiNET.Madness/ArrayMadness/Array.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// _ __ __
// ___ ___ ___ _ __ __| | __ _ | \/ |
// / __|/ __| / _ \| '_ \ / _` | / _` || |\/| |
// \__ \\__ \| __/| | | || (_| || (_| || | | |
// |___/|___/ \___||_| |_| \__,_| \__,_||_| |_|
// |
// Copyright 2021-2022 Łukasz "JustArchi" Domeradzki
// Contact: JustArchi@JustArchi.net
// |
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// |
// http://www.apache.org/licenses/LICENSE-2.0
// |
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using JetBrains.Annotations;
using JustArchiNET.Madness.Helpers;

namespace JustArchiNET.Madness.ArrayMadness;

[MadnessType(EMadnessType.Replacement)]
[PublicAPI]
public static class Array {
[MadnessType(EMadnessType.Implementation)]
public static int MaxLength => 0X7FFFFFC7;

[MadnessType(EMadnessType.Proxy)]
public static void Copy(System.Array sourceArray, System.Array destinationArray, int length) => System.Array.Copy(sourceArray, destinationArray, length);

[MadnessType(EMadnessType.Proxy)]
public static void Copy(System.Array sourceArray, int sourceIndex, System.Array destinationArray, int destinationIndex, int length) => System.Array.Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length);

[MadnessType(EMadnessType.Proxy)]
public static T[] Empty<T>() => System.Array.Empty<T>();

[MadnessType(EMadnessType.Proxy)]
public static void Reverse<T>(T[] array) => System.Array.Reverse(array);
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Example:

<Using Include="JustArchiNET.Madness" />
<Using Include="JustArchiNET.Madness.ArgumentNullExceptionMadness.ArgumentNullException" Alias="ArgumentNullException" />
<Using Include="JustArchiNET.Madness.ArrayMadness.Array" Alias="Array" />
<Using Include="JustArchiNET.Madness.ConvertMadness.Convert" Alias="Convert" />
<Using Include="JustArchiNET.Madness.EnumMadness.Enum" Alias="Enum" />
<Using Include="JustArchiNET.Madness.EnvironmentMadness.Environment" Alias="Environment" />
Expand Down

0 comments on commit e1e7ba1

Please sign in to comment.