pdo400/smooth.foundations — pull request #1 by tlgkccampbell (2014-05-07 02:22:22+00:00)
Title: Port to enable use with non-Unity projects

Hello,

I saw your post on /r/gamedev the other day and was very impressed with your project, but since I don't work with Unity I wasn't able to make use of it. So I've taken it upon myself to create a Visual Studio solution and refactor what code was necessary to make the project run on the Microsoft CLR. I'm new to this whole github thing, so forgive me if I've screwed anything up.

By far the most significant change was that I renamed Smooth.Tuple to Smooth.Stuple in order to avoid conflicts with the System.Tuple type. I was hesitant to make a breaking change like this, but the alternatives seemed worse.

Other than that, only a few changes were necessary:

1. A new flag, STANDARD_RUNTIME, is set by the VS project in order to identify a non-Unity environment.
2. All references to the UnityEngine logging methods were replaced with calls to a new class in Smooth.Debugging, which uses System.Diagnostics.Debug in the standard CLR.
3. Under the standard runtime, references to UnityEngine's RandomRange method in IListExtensions were replaced with calls to a thread-local static instance of System.Random.
4. Alternative versions of the BasePlatform and PlatformExtensions classes are used which do very (very) simple platform checking based on Environment.OSVersion and which assume that JIT is always available.
5. The Smooth.Compare Configuration class was updated to skip Unity types when STANDARD_RUNTIME is set.

I think that about covers it. Please let me know if you have any questions or concerns.