-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
104 additions
and
20 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Terraforming.Shims | ||
{ | ||
public static class Pool<T> where T: new() | ||
{ | ||
public static T Get() | ||
{ | ||
return new T(); | ||
} | ||
} | ||
|
||
public class ListPool<T>: IDisposable | ||
{ | ||
private bool disposedValue; | ||
|
||
public List<T> list = new List<T>(); | ||
|
||
protected virtual void Dispose(bool disposing) | ||
{ | ||
if (!disposedValue) | ||
{ | ||
if (disposing) | ||
{ | ||
list.Clear(); | ||
} | ||
|
||
disposedValue = true; | ||
} | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
// Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method | ||
Dispose(disposing: true); | ||
GC.SuppressFinalize(this); | ||
} | ||
} | ||
} |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Terraforming.Tools | ||
{ | ||
internal static class HandReticleExtensions | ||
{ | ||
public static string GetHandSubscript(this HandReticle handReticle) | ||
{ | ||
#if BelowZero | ||
return handReticle.textHandSubscript; | ||
#else | ||
return handReticle.interactText2; | ||
#endif | ||
} | ||
|
||
public static void SetHandSubscriptText(this HandReticle handReticle, string subscriptText) | ||
{ | ||
#if BelowZero | ||
handReticle.SetTextRaw(HandReticle.TextType.HandSubscript, subscriptText); | ||
#else | ||
handReticle.SetInteractText(handReticle.interactText1, subscriptText); | ||
#endif | ||
} | ||
} | ||
} |