From 01a94c29d0994a6868fc13f2446736b34549f81a Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 4 Nov 2016 14:47:54 -0400 Subject: remove unused SGame fields & methods --- src/StardewModdingAPI/Inheritance/SGame.cs | 59 ------------------------------ 1 file changed, 59 deletions(-) (limited to 'src') diff --git a/src/StardewModdingAPI/Inheritance/SGame.cs b/src/StardewModdingAPI/Inheritance/SGame.cs index 4c803b23..8f751bc7 100644 --- a/src/StardewModdingAPI/Inheritance/SGame.cs +++ b/src/StardewModdingAPI/Inheritance/SGame.cs @@ -161,9 +161,6 @@ namespace StardewModdingAPI.Inheritance [Obsolete("Use Game1.player instead")] public Farmer CurrentFarmer => Game1.player; - /// Get ALL static fields that belong to 'Game1'. - public static FieldInfo[] GetStaticFields => typeof(Game1).GetFields(); - /// The game method which draws the farm buildings. public static MethodInfo DrawFarmBuildings = typeof(Game1).GetMethod("drawFarmBuildings", BindingFlags.NonPublic | BindingFlags.Instance); @@ -173,27 +170,6 @@ namespace StardewModdingAPI.Inheritance /// The game method which draws the current dialogue box, if any. public static MethodInfo DrawDialogueBox = typeof(Game1).GetMethod("drawDialogueBox", BindingFlags.NonPublic | BindingFlags.Instance); - /// The game method which handles any escape keys that are currently pressed (e.g. closing the active menu). - public static MethodInfo CheckForEscapeKeys = typeof(Game1).GetMethod("checkForEscapeKeys", BindingFlags.NonPublic | BindingFlags.Instance); - - /// The game method which detects and handles user input. This includes updating state, checking for hover actions, propagating clicks, etc. - public static MethodInfo UpdateControlInput = typeof(Game1).GetMethod("UpdateControlInput", BindingFlags.NonPublic | BindingFlags.Instance); - - /// The game method which updates player characters (see ). - public static MethodInfo UpdateCharacters = typeof(Game1).GetMethod("UpdateCharacters", BindingFlags.NonPublic | BindingFlags.Instance); - - /// The game method which updates all locations. - public static MethodInfo UpdateLocations = typeof(Game1).GetMethod("UpdateLocations", BindingFlags.NonPublic | BindingFlags.Instance); - - /// The game method which gets the viewport-relative coordinate at the center of the screen. - public static MethodInfo getViewportCenter = typeof(Game1).GetMethod("getViewportCenter", BindingFlags.NonPublic | BindingFlags.Instance); - - /// The game method which updates the title screen to reflect time and user input. - public static MethodInfo UpdateTitleScreen = typeof(Game1).GetMethod("UpdateTitleScreen", BindingFlags.NonPublic | BindingFlags.Instance); - - // unused? - public delegate void BaseBaseDraw(); - /********* ** Public methods @@ -285,41 +261,6 @@ namespace StardewModdingAPI.Inheritance return buttons.ToArray(); } - /// Safely invoke a private non-static method. If the invocation fails, this logs an error and returns null. - /// The method name to find. - /// The parameters to pass to the method. - /// Returns the method return value (or null if void). - [Obsolete("This is very slow. Cache the method info and then invoke it with InvokeMethodInfo().")] - public static object InvokeBasePrivateInstancedMethod(string name, params object[] parameters) - { - try - { - return typeof(Game1).GetMethod(name, BindingFlags.NonPublic | BindingFlags.Instance).Invoke(Program.gamePtr, parameters); - } - catch - { - Log.AsyncR($"Failed to call base method '{name}'"); - return null; - } - } - - /// Safely invoke a method with the given parameters. If the invocation fails, this logs an error and returns null. - /// The method to invoke. - /// The parameters to pass to the method. - /// Returns the method return value (or null if void). - public static object InvokeMethodInfo(MethodInfo method, params object[] parameters) - { - try - { - return method.Invoke(Program.gamePtr, parameters); - } - catch - { - Log.AsyncR($"Failed to call base method '{method.Name}'"); - return null; - } - } - /// Queue a message to be added to the debug output. /// The message to add. /// Returns whether the message was successfully queued. -- cgit