Skip to content

Commit

Permalink
Remove Contracts because it is not supported in recent Visual Studio …
Browse files Browse the repository at this point in the history
…anymore
  • Loading branch information
laqieer committed Sep 12, 2022
1 parent 33a6251 commit 0475220
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 16 deletions.
6 changes: 4 additions & 2 deletions Event Assembler/Core/Core.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--Project was exported from assembly: E:\crazycolorz5\Dropbox\Unified FE Hacking\ToolBox\EA V9.12.1\Core.exe-->
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{224C71E2-5E52-4910-910A-6FA9C2F937BE}</ProjectGuid>
<OutputType>Exe</OutputType>
<AssemblyName>Core</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<RootNamespace>Nintenlord.Event_Assembler.Core</RootNamespace>
<TargetFrameworkProfile />
Expand Down Expand Up @@ -37,6 +37,7 @@
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>true</UseVSHostingProcess>
<ConsolePause>false</ConsolePause>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -46,6 +47,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion Event Assembler/Core/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Event Assembler/Core/app.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
19 changes: 11 additions & 8 deletions Nintenlord/Collections/Lists/LinkedArrayList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Collections.Generic;
using System.Linq;
using Nintenlord.Utility.Primitives;
using System.Diagnostics.Contracts;

namespace Nintenlord.Collections.Lists
{
Expand All @@ -22,8 +21,8 @@ public T First
{
get
{
Contract.Requires<InvalidOperationException>
(count > 0, "Can't take the first of empty collection.");
if (count <= 0)
throw new Exception("Can't take the first of empty collection.");

return items[firstReservedIndex];
}
Expand All @@ -32,8 +31,9 @@ public T Last
{
get
{
Contract.Requires<InvalidOperationException>
(count > 0, "Can't take the last of empty collection.");

if (count <= 0)
throw new Exception("Can't take the last of empty collection.");

return firstFreeIndex > 0 ? items[firstFreeIndex - 1] : items[items.Length - 1];
}
Expand Down Expand Up @@ -191,7 +191,8 @@ private int Find(T item)

private void InsertAtInternalIndex(int internalIndex, T item)
{
Contract.Requires(count < items.Length);
if (count >= items.Length)
throw new Exception("No enough room to insert.");
//There is always room on the array at this point

if (firstReservedIndex < firstFreeIndex)
Expand Down Expand Up @@ -447,7 +448,8 @@ public int IndexOf(T item)

public void Insert(int index, T item)
{
Contract.Requires<IndexOutOfRangeException>(index >= 0 && index <= count);
if (index < 0 || index > count)
throw new IndexOutOfRangeException();

if (index == count)
{
Expand All @@ -465,7 +467,8 @@ public void Insert(int index, T item)

public void RemoveAt(int index)
{
Contract.Requires<IndexOutOfRangeException>(index >= 0 && index < count);
if (index < 0 || index >= count)
throw new IndexOutOfRangeException();

RemoveAtInternal(ToInternalIndex(index));
}
Expand Down
9 changes: 7 additions & 2 deletions Nintenlord/Nintenlord.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -10,8 +10,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Nintenlord</RootNamespace>
<AssemblyName>Nintenlord</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -21,6 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -29,6 +31,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -39,6 +42,7 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
Expand All @@ -50,6 +54,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup />
<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Nintenlord/Utility/SharedDirtyBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics.Contracts;

namespace Nintenlord.Utility
{
Expand Down Expand Up @@ -41,7 +40,8 @@ public int Length

public DirtyBufferUser(SharedDirtyBuffer<T> listToUse)
{
Contract.Requires<ArgumentException>(!listToUse.InUse, "Argument listToUse is already in use.");
if (listToUse.InUse)
throw new ArgumentException("Argument listToUse is already in use.");

this.listToUse = listToUse;
this.listToUse.InUse = true;
Expand Down

0 comments on commit 0475220

Please sign in to comment.