Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #1 - Improve semantic to future #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Promises/Promises.Tests/V1/Tests/PromiseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public void Promise_CastToIPromiseBase_Catch_InvokesCallback_WhenPromiseIsFailed
IPromise promise = new Promise();
promise.Fail(new Exception());

var testPromise = (IPromiseBase)promise;
var testPromise = (IFuture)promise;

testPromise.Catch(delegate
{
Expand Down Expand Up @@ -2305,7 +2305,7 @@ public void Promise_Then_InvokesCallback_WhenPromiseIsResolved_WhenCastToIPromis
{
bool didResolve = false;

IPromiseBase promise = (IPromiseBase)GetResolvedPromise();
var promise = (IFuture)GetResolvedPromise();

promise.Then(delegate
{
Expand Down Expand Up @@ -3625,7 +3625,7 @@ public void GenericPromise_Then_InvokesCallback_WhenPromiseIsResolved()
public void GenericPromise_Then_InvokesCallback_WhenPromiseIsResolved_WhenCastIPromiseBase()
{
bool didResolve = false;
var promise = (IPromiseBase<bool>)GetBoolResolvedPromise(true);
var promise = (IFuture<bool>)GetBoolResolvedPromise(true);
promise.Then(delegate (bool value)
{
Assert.AreEqual(value, true);
Expand Down
2 changes: 1 addition & 1 deletion Promises/Promises/Promises.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<Compile Include="V1\Core\Promise.cs" />
<Compile Include="V1\Core\PromiseState.cs" />
<Compile Include="V1\Interfaces\IPromise.cs" />
<Compile Include="V1\Interfaces\IPromiseBase.cs" />
<Compile Include="V1\Interfaces\IFuture.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Promises.nuspec">
Expand Down
2 changes: 1 addition & 1 deletion Promises/Promises/Promises.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<description>$description$</description>
<!--*-->
<releaseNotes>
Adding lib/unity to NuGet package for supporting NuGetForUnity.
Semantic change from IPromiseBase to IFuture. IPromiseBase made obsolete, will remove in future version.
</releaseNotes>
<copyright>$copyright$</copyright>
<tags> </tags>
Expand Down
4 changes: 2 additions & 2 deletions Promises/Promises/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.6.3")]
[assembly: AssemblyFileVersion("1.6.3")]
[assembly: AssemblyVersion("1.7.0")]
[assembly: AssemblyFileVersion("1.7.0")]
80 changes: 40 additions & 40 deletions Promises/Promises/V1/Core/Promise.cs
Original file line number Diff line number Diff line change
Expand Up @@ -768,110 +768,110 @@ protected virtual void ClearPromiseHandlers()
#region IPromiseBase Implementation

#region Catch
IPromiseBase IPromiseBase.Catch(Action<Exception> callback)
IFuture IFuture.Catch(Action<Exception> callback)
{
return Catch(callback);
}

IPromiseBase IPromiseBase.Catch<TException>(Action<TException> callback)
IFuture IFuture.Catch<TException>(Action<TException> callback)
{
return Catch(callback);
}
#endregion

#region Then
IPromiseBase IPromiseBase.Then(Action callback)
IFuture IFuture.Then(Action callback)
{
return Then(callback);
}


IPromiseBase IPromiseBase.Then<P1>(Action<P1> callback, P1 property1)
IFuture IFuture.Then<P1>(Action<P1> callback, P1 property1)
{
return Then(callback, property1);
}

IPromiseBase IPromiseBase.Then<P1, P2>(Action<P1, P2> callback, P1 property1, P2 property2)
IFuture IFuture.Then<P1, P2>(Action<P1, P2> callback, P1 property1, P2 property2)
{
return Then(callback, property1, property2);
}

IPromiseBase IPromiseBase.Then<P1, P2, P3>(Action<P1, P2, P3> callback, P1 property1, P2 property2, P3 property3)
IFuture IFuture.Then<P1, P2, P3>(Action<P1, P2, P3> callback, P1 property1, P2 property2, P3 property3)
{
return Then(callback, property1, property2, property3);
}

IPromiseBase<T> IPromiseBase.Then<T>(Func<T> callback)
IFuture<T> IFuture.Then<T>(Func<T> callback)
{
return Then(callback);
}

IPromiseBase<T> IPromiseBase.Then<T, P1>(Func<P1, T> callback, P1 property1)
IFuture<T> IFuture.Then<T, P1>(Func<P1, T> callback, P1 property1)
{
return Then(callback, property1);
}

IPromiseBase<T> IPromiseBase.Then<T, P1, P2>(Func<P1, P2, T> callback, P1 property1, P2 property2)
IFuture<T> IFuture.Then<T, P1, P2>(Func<P1, P2, T> callback, P1 property1, P2 property2)
{
return Then(callback, property1, property2);
}

IPromiseBase<T> IPromiseBase.Then<T, P1, P2, P3>(Func<P1, P2, P3, T> callback, P1 property1, P2 property2, P3 property3)
IFuture<T> IFuture.Then<T, P1, P2, P3>(Func<P1, P2, P3, T> callback, P1 property1, P2 property2, P3 property3)
{
return Then(callback, property1, property2, property3);
}
#endregion

#region Chain
public IPromiseBase Chain(Func<IPromiseBase> callback)
public IFuture Chain(Func<IFuture> callback)
{
return Chain(callback);
}
public IPromiseBase Chain<P1>(Func<P1, IPromiseBase> callback, P1 property1)
public IFuture Chain<P1>(Func<P1, IFuture> callback, P1 property1)
{
return Chain(callback, property1);
}

public IPromiseBase Chain<P1, P2>(Func<P1, P2, IPromiseBase> callback, P1 property1, P2 property2)
public IFuture Chain<P1, P2>(Func<P1, P2, IFuture> callback, P1 property1, P2 property2)
{
return Chain(callback, property1, property2);
}

public IPromiseBase Chain<P1, P2, P3>(Func<P1, P2, P3, IPromiseBase> callback, P1 property1, P2 property2, P3 property3)
public IFuture Chain<P1, P2, P3>(Func<P1, P2, P3, IFuture> callback, P1 property1, P2 property2, P3 property3)
{
return Chain(callback, property1, property2, property3);
}

public IPromiseBase<T> Chain<T>(Func<IPromiseBase<T>> callback)
public IFuture<T> Chain<T>(Func<IFuture<T>> callback)
{
return Chain(callback);
}

public IPromiseBase<T> Chain<T, P1>(Func<P1, IPromiseBase<T>> callback, P1 property1)
public IFuture<T> Chain<T, P1>(Func<P1, IFuture<T>> callback, P1 property1)
{
return Chain(callback, property1);
}

public IPromiseBase<T> Chain<T, P1, P2>(Func<P1, P2, IPromiseBase<T>> callback, P1 property1, P2 property2)
public IFuture<T> Chain<T, P1, P2>(Func<P1, P2, IFuture<T>> callback, P1 property1, P2 property2)
{
return Chain(callback, property1, property2);
}

public IPromiseBase<T> Chain<T, P1, P2, P3>(Func<P1, P2, P3, IPromiseBase<T>> callback, P1 property1, P2 property2, P3 property3)
public IFuture<T> Chain<T, P1, P2, P3>(Func<P1, P2, P3, IFuture<T>> callback, P1 property1, P2 property2, P3 property3)
{
return Chain(callback, property1, property2, property3);
}
#endregion

#region Progress
IPromiseBase IPromiseBase.Progress(Action<float> progressHandler)
IFuture IFuture.Progress(Action<float> progressHandler)
{
return Progress(progressHandler);
}
#endregion

#region Finally
IPromiseBase IPromiseBase.Finally(Action callback)
IFuture IFuture.Finally(Action callback)
{
return Finally(callback);
}
Expand Down Expand Up @@ -1460,110 +1460,110 @@ protected override void ClearPromiseHandlers()

#region IPromiseBase Implementation
#region Then
IPromiseBase<T1> IPromiseBase<T1>.Then(Action<T1> callback)
IFuture<T1> IFuture<T1>.Then(Action<T1> callback)
{
return Then(callback);
}

IPromiseBase<T1> IPromiseBase<T1>.Then<P1>(Action<T1, P1> callback, P1 property1)
IFuture<T1> IFuture<T1>.Then<P1>(Action<T1, P1> callback, P1 property1)
{
return Then(callback, property1);
}

IPromiseBase<T1> IPromiseBase<T1>.Then<P1, P2>(Action<T1, P1, P2> callback, P1 property1, P2 property2)
IFuture<T1> IFuture<T1>.Then<P1, P2>(Action<T1, P1, P2> callback, P1 property1, P2 property2)
{
return Then(callback, property1, property2);
}

IPromiseBase<T1> IPromiseBase<T1>.Then<P1, P2, P3>(Action<T1, P1, P2, P3> callback, P1 property1, P2 property2, P3 property3)
IFuture<T1> IFuture<T1>.Then<P1, P2, P3>(Action<T1, P1, P2, P3> callback, P1 property1, P2 property2, P3 property3)
{
return Then(callback, property1, property2, property3);
}

IPromiseBase<T2> IPromiseBase<T1>.Then<T2>(Func<T1, T2> callback)
IFuture<T2> IFuture<T1>.Then<T2>(Func<T1, T2> callback)
{
return Then(callback);
}

IPromiseBase<T2> IPromiseBase<T1>.Then<T2, P1>(Func<T1, P1, T2> callback, P1 property1)
IFuture<T2> IFuture<T1>.Then<T2, P1>(Func<T1, P1, T2> callback, P1 property1)
{
return Then(callback, property1);
}

IPromiseBase<T2> IPromiseBase<T1>.Then<T2, P1, P2>(Func<T1, P1, P2, T2> callback, P1 property1, P2 property2)
IFuture<T2> IFuture<T1>.Then<T2, P1, P2>(Func<T1, P1, P2, T2> callback, P1 property1, P2 property2)
{
return Then(callback, property1, property2);
}

IPromiseBase<T2> IPromiseBase<T1>.Then<T2, P1, P2, P3>(Func<T1, P1, P2, P3, T2> callback, P1 property1, P2 property2, P3 property3)
IFuture<T2> IFuture<T1>.Then<T2, P1, P2, P3>(Func<T1, P1, P2, P3, T2> callback, P1 property1, P2 property2, P3 property3)
{
return Then(callback, property1, property2, property3);
}
#endregion

#region Chain
public IPromiseBase Chain(Func<T1, IPromiseBase> callback)
public IFuture Chain(Func<T1, IFuture> callback)
{
return Chain(callback);
}

public IPromiseBase Chain<P1>(Func<T1, P1, IPromiseBase> callback, P1 property1)
public IFuture Chain<P1>(Func<T1, P1, IFuture> callback, P1 property1)
{
return Chain(callback, property1);
}

public IPromiseBase Chain<P1, P2>(Func<T1, P1, P2, IPromiseBase> callback, P1 property1, P2 property2)
public IFuture Chain<P1, P2>(Func<T1, P1, P2, IFuture> callback, P1 property1, P2 property2)
{
return Chain(callback, property1, property2);
}

public IPromiseBase Chain<P1, P2, P3>(Func<T1, P1, P2, P3, IPromiseBase> callback, P1 property1, P2 property2, P3 property3)
public IFuture Chain<P1, P2, P3>(Func<T1, P1, P2, P3, IFuture> callback, P1 property1, P2 property2, P3 property3)
{
return Chain(callback, property1, property2, property3);
}

public IPromiseBase<T2> Chain<T2>(Func<T1, IPromiseBase<T2>> callback)
public IFuture<T2> Chain<T2>(Func<T1, IFuture<T2>> callback)
{
return Chain(callback);
}

public IPromiseBase<T2> Chain<T2, P1>(Func<T1, P1, IPromiseBase<T2>> callback, P1 property1)
public IFuture<T2> Chain<T2, P1>(Func<T1, P1, IFuture<T2>> callback, P1 property1)
{
return Chain(callback, property1);
}

public IPromiseBase<T2> Chain<T2, P1, P2>(Func<T1, P1, P2, IPromiseBase<T2>> callback, P1 property1, P2 property2)
public IFuture<T2> Chain<T2, P1, P2>(Func<T1, P1, P2, IFuture<T2>> callback, P1 property1, P2 property2)
{
return Chain(callback, property1, property2);
}

public IPromiseBase<T2> Chain<T2, P1, P2, P3>(Func<T1, P1, P2, P3, IPromiseBase<T2>> callback, P1 property1, P2 property2, P3 property3)
public IFuture<T2> Chain<T2, P1, P2, P3>(Func<T1, P1, P2, P3, IFuture<T2>> callback, P1 property1, P2 property2, P3 property3)
{
return Chain(callback, property1, property2, property3);
}
#endregion

#region Catch
IPromiseBase<T1> IPromiseBase<T1>.Catch(Action<Exception> callback)
IFuture<T1> IFuture<T1>.Catch(Action<Exception> callback)
{
return Catch(callback);
}

IPromiseBase<T1> IPromiseBase<T1>.Catch<TException>(Action<TException> callback)
IFuture<T1> IFuture<T1>.Catch<TException>(Action<TException> callback)
{
return Catch(callback);
}
#endregion

#region Progress
IPromiseBase<T1> IPromiseBase<T1>.Progress(Action<float> progressHandler)
IFuture<T1> IFuture<T1>.Progress(Action<float> progressHandler)
{
return Progress(progressHandler);
}
#endregion

#region Finally
IPromiseBase<T1> IPromiseBase<T1>.Finally(Action callback)
IFuture<T1> IFuture<T1>.Finally(Action callback)
{
return Finally(callback);
}
Expand Down
Loading