예제 #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
        }
예제 #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;
 }
예제 #3
0
 /// <summary>
 /// Get the Player's current health
 /// </summary>
 public static double GetHealth(this InGame inGame)
 {
     return(inGame.GetSimulation().health.Value);
 }
예제 #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);
 }
예제 #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;
 }
예제 #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);
 }
예제 #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);
 }
예제 #8
0
 /// <summary>
 /// (Cross-Game compatible) Get the current Map
 /// </summary>
 public static Map GetMap(this InGame inGame)
 {
     return(inGame.GetSimulation()?.Map);
 }
예제 #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);
 }
예제 #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);
 }
예제 #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;
 }
예제 #12
0
 /// <summary>
 /// Get the player's max health
 /// </summary>
 public static double GetMaxHealth(this InGame inGame)
 {
     return(inGame.GetSimulation().maxHealth);
 }
예제 #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;
 }
예제 #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;
 }
예제 #15
0
 /// <summary>
 /// Get the Player's current cash
 /// </summary>
 public static double GetCash(this InGame inGame)
 {
     return(inGame.GetSimulation().Cash);
 }
예제 #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());
        }