public Route FindRoute(
            int wptIndex, string icao, string rwy,
            StarCollection starCol, IReadOnlyList <string> stars)
        {
            var editor  = wptList.GetEditor();
            var handler = new StarHandler(icao, starCol, wptList, editor, airportList);

            return(finder.FindRoute(wptIndex, new DestInfo(rwy, stars, handler), editor));
        }
Example #2
0
 public override bool UseItem(Player player)
 {
     if (!Main.dedServ)
     {
         StarHandler.SpawnStars();
     }
     //PlanetMod.NewSubworld();
     return(true);
 }
    void OnTriggerEnter2D(Collider2D collider)
    {
        if (collider is BoxCollider2D)
        {
            GameObject starSpawn = GameObject.Find("StarSpawn");                        //This is to reference to StarSpawn
            if (starSpawn != null)
            {
                starHandler = starSpawn.GetComponent <StarHandler>();                    //Otherwise gives out error
            }

            target = collider.gameObject;                                               //Shortens code a bit

//          if (collider.tag == "Character" || collider.tag == "Enemy")                 //Checks if hits a character or enemy
            switch (target.tag)
            {
            case "Character":
                if (GameObject.ReferenceEquals(target, dropper))                        //if dropper == self
                {
                    target.GetComponent <PlayerScore>().SetPoints(-1000);               //Character loses tons of points for suicide
                }
                if (dropper != null)
                {
                    dropper.GetComponent <PlayerScore>().SetPoints(+500);               //Dropper gains points for kill
                }
                target.GetComponent <PlayerHealth>().LoseLife();                        //Character life -1
                break;


            case "Enemy":
                if (GameObject.ReferenceEquals(target, dropper))                        //if dropper == self
                {
                    target.GetComponent <PlayerScore>().SetPoints(-1000);               //minuspoints for suicide
                }
                if (dropper != null)
                {
                    dropper.GetComponent <PlayerScore>().SetPoints(+500);               //points for kill
                }
                target.GetComponent <EnemyHealth>().LoseLife();                         //target life -1
                break;

            case "Explosive":
                target.GetComponent <BombExplosion>().Explode();            //Explodes other explosions
                break;


            case "Collectables":                                            // Destroy collectable
                //if (target.GetComponent<Star>() != null)
                if (target.GetComponent <Star>().CountProxy() < 1)
                {
                    starHandler.SpawnRand();                                //Spawn to random location
                }
                starHandler.DestroyStar(target);                            //Destroy target Star
                break;
            }
        }
    }
        public Route FindRoute(
            string origIcao,
            string origRwy,
            SidCollection sidCol,
            IReadOnlyList <string> sids,
            string destIcao,
            string destRwy,
            StarCollection starCol,
            IReadOnlyList <string> stars)
        {
            var editor      = wptList.GetEditor();
            var sidHandler  = new SidHandler(origIcao, sidCol, wptList, editor, airportList);
            var starHandler = new StarHandler(destIcao, starCol, wptList, editor, airportList);

            return(finder.FindRoute(
                       new OrigInfo(origRwy, sids, sidHandler),
                       new DestInfo(destRwy, stars, starHandler),
                       editor));
        }
Example #5
0
 public override void Update(GameTime gameTime)
 {
     StarHandler.UpdateStars();
 }
Example #6
0
 public override void OnLoad()
 {
     StarHandler.SpawnStars();
 }
Example #7
0
 public DestInfo(string Rwy, IReadOnlyList <string> Stars, StarHandler Handler)
 {
     this.Rwy     = Rwy;
     this.Stars   = Stars;
     this.Handler = Handler;
 }