Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions Assets/Plugins.meta

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

8 changes: 8 additions & 0 deletions Assets/Plugins/Zenject.meta

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

23 changes: 23 additions & 0 deletions Assets/Plugins/Zenject/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
The MIT License (MIT)

Copyright (c) 2010-2015 Modest Tree Media http://www.modesttree.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

https://github.com/svermeulen/Extenject/blob/master/License.md
8 changes: 8 additions & 0 deletions Assets/Plugins/Zenject/LICENSE.txt.meta

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

2 changes: 2 additions & 0 deletions Assets/Plugins/Zenject/ReadMe.url
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[InternetShortcut]
URL=https://github.com/svermeulen/Extenject
9 changes: 9 additions & 0 deletions Assets/Plugins/Zenject/ReadMe.url.meta

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

9 changes: 9 additions & 0 deletions Assets/Plugins/Zenject/Source.meta

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

9 changes: 9 additions & 0 deletions Assets/Plugins/Zenject/Source/Binding.meta

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

9 changes: 9 additions & 0 deletions Assets/Plugins/Zenject/Source/Binding/BindInfo.meta

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

100 changes: 100 additions & 0 deletions Assets/Plugins/Zenject/Source/Binding/BindInfo/BindInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Zenject.Internal;

namespace Zenject
{
public enum ScopeTypes
{
Unset,
Transient,
Singleton
}

public enum ToChoices
{
Self,
Concrete
}

public enum InvalidBindResponses
{
Assert,
Skip
}

public enum BindingInheritanceMethods
{
None,
CopyIntoAll,
CopyDirectOnly,
MoveIntoAll,
MoveDirectOnly
}

[NoReflectionBaking]
public class BindInfo : IDisposable
{
public bool MarkAsCreationBinding;
public bool MarkAsUniqueSingleton;
public object ConcreteIdentifier;
public bool SaveProvider;
public bool OnlyBindIfNotBound;
public bool RequireExplicitScope;
public object Identifier;
public readonly List<Type> ContractTypes;
public BindingInheritanceMethods BindingInheritanceMethod;
public InvalidBindResponses InvalidBindResponse;
public bool NonLazy;
public BindingCondition Condition;
public ToChoices ToChoice;
public string ContextInfo;
public readonly List<Type> ToTypes; // Only relevant with ToChoices.Concrete
public ScopeTypes Scope;
public readonly List<TypeValuePair> Arguments;
public Action<InjectContext, object> InstantiatedCallback;

public BindInfo()
{
ContractTypes = new List<Type>();
ToTypes = new List<Type>();
Arguments = new List<TypeValuePair>();

Reset();
}

public void Dispose()
{
ZenPools.DespawnBindInfo(this);
}

[Conditional("UNITY_EDITOR")]
public void SetContextInfo(string contextInfo)
{
ContextInfo = contextInfo;
}

public void Reset()
{
MarkAsCreationBinding = true;
MarkAsUniqueSingleton = false;
ConcreteIdentifier = null;
SaveProvider = false;
OnlyBindIfNotBound = false;
RequireExplicitScope = false;
Identifier = null;
ContractTypes.Clear();
BindingInheritanceMethod = BindingInheritanceMethods.None;
InvalidBindResponse = InvalidBindResponses.Assert;
NonLazy = false;
Condition = null;
ToChoice = ToChoices.Self;
ContextInfo = null;
ToTypes.Clear();
Scope = ScopeTypes.Unset;
Arguments.Clear();
InstantiatedCallback = null;
}
}
}
12 changes: 12 additions & 0 deletions Assets/Plugins/Zenject/Source/Binding/BindInfo/BindInfo.cs.meta

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

83 changes: 83 additions & 0 deletions Assets/Plugins/Zenject/Source/Binding/BindInfo/BindStatement.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
using System;
using System.Collections.Generic;
using ModestTree;
using Zenject.Internal;

namespace Zenject
{
[NoReflectionBaking]
public class BindStatement : IDisposable
{
readonly List<IDisposable> _disposables;
IBindingFinalizer _bindingFinalizer;

public BindStatement()
{
_disposables = new List<IDisposable>();
Reset();
}

public BindingInheritanceMethods BindingInheritanceMethod
{
get
{
AssertHasFinalizer();
return _bindingFinalizer.BindingInheritanceMethod;
}
}

public bool HasFinalizer
{
get { return _bindingFinalizer != null; }
}

public void SetFinalizer(IBindingFinalizer bindingFinalizer)
{
_bindingFinalizer = bindingFinalizer;
}

void AssertHasFinalizer()
{
if (_bindingFinalizer == null)
{
throw Assert.CreateException(
"Unfinished binding! Some required information was left unspecified.");
}
}

public void AddDisposable(IDisposable disposable)
{
_disposables.Add(disposable);
}

public BindInfo SpawnBindInfo()
{
var bindInfo = ZenPools.SpawnBindInfo();
AddDisposable(bindInfo);
return bindInfo;
}

public void FinalizeBinding(DiContainer container)
{
AssertHasFinalizer();
_bindingFinalizer.FinalizeBinding(container);
}

public void Reset()
{
_bindingFinalizer = null;

for (int i = 0; i < _disposables.Count; i++)
{
_disposables[i].Dispose();
}

_disposables.Clear();
}

public void Dispose()
{
ZenPools.DespawnStatement(this);
}
}
}

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

31 changes: 31 additions & 0 deletions Assets/Plugins/Zenject/Source/Binding/BindInfo/FactoryBindInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;

namespace Zenject
{
[NoReflectionBaking]
public class FactoryBindInfo
{
public FactoryBindInfo(Type factoryType)
{
FactoryType = factoryType;
Arguments = new List<TypeValuePair>();
}

public Type FactoryType
{
get; private set;
}

public Func<DiContainer, IProvider> ProviderFunc
{
get; set;
}

public List<TypeValuePair> Arguments
{
get;
set;
}
}
}

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

Loading