This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Newtonsoft.Json; | |
public class CustomDictionaryConverter : JsonConverter | |
{ | |
public override bool CanConvert(Type objectType) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void RemoveMissingComponentsInCurrentScene(ILevelData levelData) | |
{ | |
var badComponents = SceneManager | |
.GetActiveScene() | |
.GetRootGameObjects() | |
.Flatten() | |
.Select(gameObject => new | |
{ | |
GameObject = gameObject, | |
Components = gameObject.GetComponents<Component>() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PostActionTransformation<T> : ISpecimenBuilderTransformation | |
{ | |
private readonly List<ISpecimenCommand> _commands = new List<ISpecimenCommand>(); | |
public ISpecimenBuilder Transform(ISpecimenBuilder builder) | |
{ | |
return new Postprocessor( | |
builder, | |
new CompositeSpecimenCommand(_commands), | |
new IsAssignableToTypeSpecification(typeof(T))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using JetBrains.Annotations; | |
namespace Domm.Engine | |
{ | |
public class Recipe | |
{ | |
private readonly IReadOnlyDictionary<IIngredient, int> _ingredients; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void BindStateMachineBehavioursInActiveScenes() | |
{ | |
Enumerable.Range(0, SceneManager.sceneCount) | |
.Select(SceneManager.GetSceneAt) | |
.SelectMany(ZenUtilInternal.GetRootGameObjects) | |
.SelectMany(x => x.GetComponentsInChildren<Animator>(true)) | |
.SelectMany(x => x.GetBehaviours<StateMachineBehaviour>()) | |
.ForEach(Container.QueueForInject); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
namespace HashCodeDistributionTest | |
{ | |
public class GetHashCodeBenchmark | |
{ | |
private static readonly Hashtable _evenDistributes = new Hashtable(); | |
private static readonly Hashtable _counters = new Hashtable(); | |
public class EvenDistributed |
OlderNewer