/// <summary> /// (Cross-Game compatible) Get's all Bloons on the map /// </summary> /// <param name="inGame"></param> /// <returns></returns> public static List <Bloon> GetBloons(this InGame inGame) { #if BloonsTD6 return(inGame.GetFactory <Bloon>().all.ToList()); #elif BloonsAT return(inGame.GetSimulation().bloonManager.GetBloons().ToList()); #endif }
/// <summary> /// Add health to the players current health /// </summary> /// <param name="amount">Amount of health to add</param> public static void AddHealth(this InGame inGame, double amount) { inGame.GetSimulation().health.Value += amount; }
/// <summary> /// Get the Player's current health /// </summary> public static double GetHealth(this InGame inGame) { return(inGame.GetSimulation().health.Value); }
/// <summary> /// Get the Cash Manager for the current game /// </summary> /// <param name="index">Index of the cash manager. Default is 0</param> public static CashManager GetCashManager(this InGame inGame, int index = 0) { return(inGame.GetSimulation()?.cashManagers?.entries[index]?.value); }
/// <summary> /// Set the player's maximum health to a new value /// </summary> /// <param name="amount">Value to set max health to</param> public static void SetMaxHealth(this InGame inGame, double amount) { inGame.GetSimulation().maxHealth.Value = amount; }
/// <summary> /// (Cross-Game compatible) Get the main Factory that creates and manages all other Factories /// </summary> public static FactoryFactory GetMainFactory(this InGame inGame) { return(inGame.GetSimulation()?.factory); }
/// <summary> /// (Cross-Game compatible) The Game.model that is being used for this InGame.instance /// </summary> public static GameModel GetGameModel(this InGame inGame) { return(inGame.GetSimulation()?.model); }
/// <summary> /// (Cross-Game compatible) Get the current Map /// </summary> public static Map GetMap(this InGame inGame) { return(inGame.GetSimulation()?.Map); }
/// <summary> /// (Cross-Game compatible) Returns whether or not the player is currently in a game. /// </summary> /// <param name="inGame"></param> /// <returns></returns> public static bool IsInGame(this InGame inGame) { return(inGame.GetSimulation() != null); }
/// <summary> /// (Cross-Game compatible) Get the current TowerManager for this game session /// </summary> public static TowerManager GetTowerManager(this InGame inGame) { return(inGame.GetSimulation().towerManager); }
/// <summary> /// Add to the player's max health /// </summary> /// <param name="amount">Amount to add to the player's max health</param> public static void AddMaxHealth(this InGame inGame, float amount) { inGame.GetSimulation().maxHealth += amount; }
/// <summary> /// Get the player's max health /// </summary> public static double GetMaxHealth(this InGame inGame) { return(inGame.GetSimulation().maxHealth); }
/// <summary> /// Set player's health to specific amount /// </summary> /// <param name="amount">Value to set health to</param> public static void SetHealth(this InGame inGame, float amount) { inGame.GetSimulation().Health = amount; }
/// <summary> /// Set the Player's cash to a specific amount /// </summary> /// <param name="amount">Value to set cash to</param> public static void SetCash(this InGame inGame, double amount) { inGame.GetSimulation().Cash = amount; }
/// <summary> /// Get the Player's current cash /// </summary> public static double GetCash(this InGame inGame) { return(inGame.GetSimulation().Cash); }
/// <summary> /// Get collection of popped bloons in this game. Right now only works for current games. Does not store results from loaded games /// </summary> /*public static System.Collections.Generic.Dictionary<string, int> GetPoppedBloons(this InGame inGame) * { * return SessionData.PoppedBloons; * }*/ /// <summary> /// Get the current instance of TowerInventory being used in this game session /// </summary> public static List <TowerInventoryEntry> GetTowerInventory(this InGame inGame) { return(inGame.GetSimulation().GetTowerInventory()); }