Example #1
0
    /// <summary>
    /// Két naprendszer összekötő útat keres meg
    /// </summary>
    /// <param name="startSystem"></param>
    /// <param name="endSystem"></param>
    /// <returns>Az útvonal elemeinek a listájával tér vissza</returns>
    public List <SolarSystem> FindWay(SolarSystem startSystem, SolarSystem endSystem)
    {
        List <SolarSystem> path = new List <SolarSystem>();

        AbsztraktAllapot Szk      = new SolarSystemAllapot(startSystem, endSystem, game.Systems);
        GrafKereso       Gk       = new BackTrack(5);
        Csucs            celcsucs = Gk.Keres(new Csucs(Szk));

        if (celcsucs == null)
        {
            Debug.Log("Nemjó");
        }
        else
        {
            Csucs cs = celcsucs;
            path.Add(cs.allapot.getCurrentSolarSystem());
            while (cs != null)
            {
                cs = cs.Szulo;
                path.Add(cs.allapot.getCurrentSolarSystem());
            }
        }

        return(path);
    }
Example #2
0
    private AbsztraktAllapot RelayTravel(SolarSystem nextSystem)
    {
        SolarSystemAllapot SSA = new SolarSystemAllapot(nextSystem, endSystem, systems);

        if (!AllapotE())
        {
            return(null);
        }

        return(SSA);
    }
Example #3
0
    public override bool Equals(object obj)
    {
        SolarSystemAllapot szk = (SolarSystemAllapot)obj;

        return(szk.currentSystem.Name == currentSystem.Name);
    }