/// <summary>
        /// (Cross-Game compatible) Return the Id of this BloonToSimulation
        /// </summary>
        /// <param name="bloonToSim"></param>
        /// <returns></returns>
        public static int GetId(this BloonToSimulation bloonToSim)
        {
#if BloonsTD6
            return(bloonToSim.id);
#elif BloonsAT
            return((int)bloonToSim.id);
#endif
        }
Beispiel #2
0
        /// <summary>
        /// Return the total distance this BloonToSim has travelled
        /// </summary>
        /// <param name="bloonToSim"></param>
        /// <returns></returns>
        public static float GetDistanceTravelled(this BloonToSimulation bloonToSim)
        {
            var distance = bloonToSim.GetBloon().distanceTraveled;

#if BloonsAT
            bloonToSim.distanceTravelled = distance;
#endif
            return(distance);
        }
        public void TrackBloonToSim(BloonToSimulation bloon)
        {
            if (currentBloonToSims.ContainsKey(bloon.GetId()))
            {
                currentBloonToSims[bloon.GetId()] = bloon;
                return;
            }

            currentBloonToSims.Add(bloon.GetId(), bloon);
        }
Beispiel #4
0
 internal static void Postfix(BloonToSimulation __instance, int id)
 {
     SessionData.bloonTracker.TrackBloonToSim(__instance);
 }
 internal static void Postfix(BloonToSimulation __instance, UnityToSimulation sim,
                              ulong id, Vector3 position, float distanceTravelled, float pathTotalDistance, BloonModel def)
 {
     SessionData.bloonTracker.TrackBloonToSim(__instance);
 }
 public void StopTrackingBloonToSim(BloonToSimulation bloon) => StopTrackingBloonToSim(bloon.GetId());
Beispiel #7
0
 /// <summary>
 /// Return the Simulation Bloon for this specific BloonToSimulation. Returns object of class Bloon
 /// </summary>
 public static Bloon GetBloon(this BloonToSimulation bloonToSim)
 {
     return(bloonToSim.GetSimBloon());
     //return SessionData.Instance.bloonTracker.GetBloon(bloonToSim.GetId());
 }
Beispiel #8
0
 /// <summary>
 /// Return the UnityDisplayNode for this bloon. Is apart of DisplayNode. Needed to modify sprites
 /// </summary>
 /// <returns></returns>
 public static UnityDisplayNode GetUnityDisplayNode(this BloonToSimulation bloonToSim)
 {
     return(bloonToSim.GetBloon().GetUnityDisplayNode());
 }
 /// <summary>
 /// (Cross-Game compatible) Return the Simulation Bloon for this specific BloonToSimulation. Returns object of class Bloon
 /// </summary>
 public static Bloon GetBloon(this BloonToSimulation bloonToSim)
 {
     return(SessionData.bloonTracker.GetBloon(bloonToSim.GetId()));
 }
 public static BloonModel GetBaseModel(this BloonToSimulation bloonToSim)
 {
     return(Game.instance?.model?.GetBloon(bloonToSim.Def.GetBaseID()));
 }
Beispiel #11
0
 /// <summary>
 /// Get the Simulation Bloon for this specific BloonToSimulation. Returns object of class Bloon
 /// </summary>
 public static Bloon GetSimBloon(this BloonToSimulation bloonToSim)
 {
     return(InGame.Bridge.simulation.bloonManager.GetBloonByID(bloonToSim.id));
 }