Beispiel #1
0
        /// <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
        }
Beispiel #2
0
 /// <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;
 }
Beispiel #3
0
 /// <summary>
 /// Get the Player's current health
 /// </summary>
 public static double GetHealth(this InGame inGame)
 {
     return(inGame.GetSimulation().health.Value);
 }
Beispiel #4
0
 /// <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);
 }
Beispiel #5
0
 /// <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;
 }
Beispiel #6
0
 /// <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);
 }
Beispiel #7
0
 /// <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);
 }
Beispiel #8
0
 /// <summary>
 /// (Cross-Game compatible) Get the current Map
 /// </summary>
 public static Map GetMap(this InGame inGame)
 {
     return(inGame.GetSimulation()?.Map);
 }
Beispiel #9
0
 /// <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);
 }
Beispiel #10
0
 /// <summary>
 /// (Cross-Game compatible) Get the current TowerManager for this game session
 /// </summary>
 public static TowerManager GetTowerManager(this InGame inGame)
 {
     return(inGame.GetSimulation().towerManager);
 }
Beispiel #11
0
 /// <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;
 }
Beispiel #12
0
 /// <summary>
 /// Get the player's max health
 /// </summary>
 public static double GetMaxHealth(this InGame inGame)
 {
     return(inGame.GetSimulation().maxHealth);
 }
Beispiel #13
0
 /// <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;
 }
Beispiel #14
0
 /// <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;
 }
Beispiel #15
0
 /// <summary>
 /// Get the Player's current cash
 /// </summary>
 public static double GetCash(this InGame inGame)
 {
     return(inGame.GetSimulation().Cash);
 }
Beispiel #16
0
        /// <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());
        }