Database Support

Refactored almost everything, but most importantly we now integrate with RethinkDB for game data.
This commit is contained in:
hyperion51 2020-03-22 19:05:26 +00:00
commit 0b46d5ee39
839 changed files with 77349 additions and 112660 deletions

View file

@ -0,0 +1,40 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;
using System.Threading.Tasks;
using UnityEngine;
public static class TaskExtensions
{
public static IEnumerator AsIEnumerator(this Task task)
{
while (!task.IsCompleted)
{
yield return null;
}
if (task.IsFaulted)
{
ExceptionDispatchInfo.Capture(task.Exception).Throw();
}
}
public static IEnumerator<T> AsIEnumerator<T>(this Task<T> task)
where T : class
{
while (!task.IsCompleted)
{
yield return null;
}
if (task.IsFaulted)
{
ExceptionDispatchInfo.Capture(task.Exception).Throw();
}
yield return task.Result;
}
}