/// <summary>
        /// Get the all AbilityToSimulation with this AbilityModel
        /// </summary>
        /// <param name="abiltyModel"></param>
        /// <returns></returns>
        public static List <AbilityToSimulation> GetAbilitySims(this AbilityModel abiltyModel)
        {
            Il2CppSystem.Collections.Generic.List <AbilityToSimulation> abilitySims = InGame.instance?.bridge?.GetAllAbilities(true);
            if (abilitySims is null || !abilitySims.Any())
            {
                return(null);
            }

            List <AbilityToSimulation> results = abilitySims.Where(ability => ability.ability.abilityModel.IsEqual(abiltyModel)).ToSystemList();

            return(results);
        }
Beispiel #2
0
        public static List <BloonToSimulation> GetBloonSims(this BloonModel bloonModel)
        {
            Il2CppSystem.Collections.Generic.List <BloonToSimulation> bloonSims = InGame.instance?.GetUnityToSimulation()?.GetAllBloons();
            if (bloonSims is null || !bloonSims.Any())
            {
                return(null);
            }

            List <BloonToSimulation> results = bloonSims.Where(b => b.GetBaseModel().IsEqual(bloonModel)).ToList();

            return(results);
        }
Beispiel #3
0
        /// <summary>
        /// Get all TowerToSimulations with this TowerModel
        /// </summary>
        public static List <TowerToSimulation> GetTowerSims(this TowerModel towerModel)
        {
            Il2CppSystem.Collections.Generic.List <TowerToSimulation> towers = InGame.instance?.bridge?.GetAllTowers();
            if (towers is null || !towers.Any())
            {
                return(null);
            }

            List <TowerToSimulation> desiredTowers = towers.Where(towerSim => towerSim.tower.towerModel.name == towerModel.name).ToSystemList();

            return(desiredTowers);
        }
        /// <summary>
        /// Get all Projectile Simulations that have this ProjectileModel
        /// </summary>
        public static List <Projectile> GetProjectileSims(this ProjectileModel projectileModel)
        {
            Il2CppSystem.Collections.Generic.List <Projectile> projectileSims =
                InGame.instance?.bridge?.GetAllProjectiles();
            if (projectileSims is null || !projectileSims.Any())
            {
                return(null);
            }

            List <Projectile> results = projectileSims
                                        .Where(projectile => projectile.projectileModel.name == projectileModel.name).ToSystemList();

            return(results);
        }