Skip to content

Commit

Permalink
Merge pull request #8 from YousicianGit/feature/ContravariantPool
Browse files Browse the repository at this point in the history
Make IPoolable contravariant
  • Loading branch information
Nezz authored Sep 27, 2023
2 parents 8e773ee + 063c701 commit 2425ace
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 64 deletions.
6 changes: 3 additions & 3 deletions AssemblyBuild/Zenject-usage/IPoolable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ public interface IPoolable
void OnSpawned();
}

public interface IPoolable<TParam1>
public interface IPoolable<in TParam1>
{
void OnDespawned();
void OnSpawned(TParam1 p1);
}

public interface IPoolable<TParam1, TParam2>
public interface IPoolable<in TParam1, in TParam2>
{
void OnDespawned();
void OnSpawned(TParam1 p1, TParam2 p2);
}

public interface IPoolable<TParam1, TParam2, TParam3>
public interface IPoolable<in TParam1, in TParam2, in TParam3>
{
void OnDespawned();
void OnSpawned(TParam1 p1, TParam2 p2, TParam3 p3);
Expand Down
66 changes: 6 additions & 60 deletions AssemblyBuild/Zenject-usage/Zenject-usage.csproj
Original file line number Diff line number Diff line change
@@ -1,54 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E22B1CBF-7E4D-48BD-953B-2B730BD9FF13}</ProjectGuid>
<TargetFramework>netstandard2.0</TargetFramework>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BuildLib</RootNamespace>
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\..\Bin\Assemblies\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<PlatformTarget>AnyCPU</PlatformTarget>
<OutputPath>bin\Debug\</OutputPath>
<IntermediateOutputPath>..\..\..\..\Temp\obj\Debug\Zenject-usage\</IntermediateOutputPath>
<BaseIntermediateOutputPath>..\..\..\..\Temp\obj\Debug\Zenject-usage\</BaseIntermediateOutputPath>
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<OutputPath>..\..\UnityProject\Assets\Plugins\Zenject\Source\Usage\</OutputPath>
<IntermediateOutputPath>..\..\..\..\Temp\obj\Release\Zenject-usage\</IntermediateOutputPath>
<BaseIntermediateOutputPath>..\..\..\..\Temp\obj\Release\Zenject-usage\</BaseIntermediateOutputPath>
<Optimize>true</Optimize>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug.InternalCloud'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\..\..\..\Bin\Assemblies\Debug.InternalCloud\</OutputPath>
<IntermediateOutputPath>..\..\..\..\Temp\obj\Debug.InternalCloud\Zenject-usage\</IntermediateOutputPath>
<BaseIntermediateOutputPath>..\..\..\..\Temp\obj\Debug.InternalCloud\Zenject-usage\</BaseIntermediateOutputPath>
<DefineConstants>TRACE;DEBUG;NOT_UNITY3D</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release.InternalCloud'">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -57,42 +33,12 @@
<BaseIntermediateOutputPath>..\..\..\..\Temp\obj\Release.InternalCloud\Zenject-usage\</BaseIntermediateOutputPath>
<DefineConstants>TRACE;DEBUG;NOT_UNITY3D</DefineConstants>
<Optimize>true</Optimize>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ItemGroup>
<Compile Include="IGuiRenderable.cs" />
<Compile Include="IInitializable.cs" />
<Compile Include="InjectableInfo.cs" />
<Compile Include="InjectAttribute.cs" />
<Compile Include="InjectLocalAttribute.cs" />
<Compile Include="InjectOptionalAttribute.cs" />
<Compile Include="InjectSources.cs" />
<Compile Include="InjectTypeInfo.cs" />
<Compile Include="IPoolable.cs" />
<Compile Include="ITickable.cs" />
<Compile Include="ILateDisposable.cs" />
<Compile Include="InjectAttributeBase.cs" />
<Compile Include="JetbrainsAnnotations.cs" />
<Compile Include="NoReflectionBakingAttribute.cs" />
<Compile Include="PreserveAttribute.cs" />
<Compile Include="ZenjectAllowDuringValidationAttribute.cs" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
</PropertyGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion AssemblyBuild/Zenject-usage/Zenject-usage.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zenject-usage", "Zenject-usage.csproj", "{E22B1CBF-7E4D-48BD-953B-2B730BD9FF13}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Zenject-usage", "Zenject-usage.csproj", "{E22B1CBF-7E4D-48BD-953B-2B730BD9FF13}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Binary file not shown.

0 comments on commit 2425ace

Please sign in to comment.