no more stateless garbage

This commit is contained in:
Chris Forbes
2010-04-13 18:46:49 +12:00
parent d8748397d1
commit e224c64ccc
45 changed files with 46 additions and 53 deletions

View File

@@ -102,12 +102,7 @@ namespace OpenRA.Traits
public interface ITraitInfo { object Create(Actor self); }
public class StatelessTraitInfo<T> : ITraitInfo
where T : new()
{
static Lazy<T> Instance = Lazy.New(() => new T());
public object Create(Actor self) { return Instance.Value; }
}
public class TraitInfo<T> : ITraitInfo where T : new() { public object Create(Actor self) { return new T(); } }
public interface ITraitPrerequisite<T> { }