private static T ReflectiveInstantiate <T>(Tx.Profile prf) where T : Profile { if (!(typeof(T).GetConstructor(new Type[] { typeof(Tx.Profile) })?.Invoke(new object[] { prf }) is T output)) { throw new Exception($"Failed to instantiate ProfileTools.Profile subclass {typeof(T).Name}. Does it have a constructor that accepts an argument of Tx.Profile?"); } return(output); }
private void Update() { if (PylonsService.instance == null) { throw new PylonsUtilSceneNotLoadedException(); } else { PylonsService.instance.GetProfile("", (s, p) => { last = p; lastHeight = StatusBlock.Last.BlockHeight; }); } }
public Profile(Tx.Profile prf) { last = prf; lastHeight = StatusBlock.Last.BlockHeight; }