Beispiel #1
0
 public redstardata(int _ix, greenstar _star, Vector3 _vecto)
 {
     ix         = _ix;
     star       = _star;
     vector     = _vecto;
     candidates = (new redstar_organizer(ix, vector)).array();
 }
Beispiel #2
0
    public redstardata make_new_red_star(int ix, Vector3 vector)
    {
        greenstar star = new greenstar();

        star.type = greenstar.Type.Red;
        star.size = 0.02f;
        redstardata r = new redstardata(ix, star, vector);

        return(r);
    }
Beispiel #3
0
    public void update_green(int index)
    {
        greenstar star = which_stars_are_green[index];

        if (!float.IsNaN(star.size))
        {
            range s = star_to_particle_range[index];
            particles[s.start].startSize  = star.size;
            particles[s.start].startColor = Config.getcolor(star.color);
            setparticles_later            = true;
        }
    }
Beispiel #4
0
    public void add_green(int i, greenstar star)
    {
        if (which_stars_are_green.ContainsKey(i))
        {
            throw new System.Exception("already green");
        }
        else
        {
            if (star == null)
            {
                star = new greenstar();
            }
            //Debug.Log("running");
            //Debug.Log(star);
            range r                    = star_to_particle_range[i];
            bool  large_star           = false;
            bool  reveal_neighbourhood = false;
            Color?thecolor             = null;
            switch (star.type)
            {
            case greenstar.Type.Green:
                thecolor             = Config.getcolor(greenstar.StarColor.Green);
                reveal_neighbourhood = true;
                break;

            case greenstar.Type.Red:
                thecolor   = Config.getcolor(greenstar.StarColor.RedLarge);
                large_star = true;
                break;

            case greenstar.Type.Quiet:
                break;

            default:
                throw new Exception("unknown type");
            }
            if (thecolor.HasValue)
            {
                particles[r.start].startColor = thecolor.Value;
                particles[r.start].startSize  = large_star? 0.02f: 0.01f;
                for (int j = 1; j < r.length; j++)
                {
                    //particles[r.start + j].startSize = 0f;
                    particles[r.start + j].startColor = thecolor.Value;
                }
            }
            else
            {
                int count = set_particles_from_star(r.start, GameDad.manystars.starlist(i));
                if (count != r.length)
                {
                    throw new Exception("starlist length was different from the expected range");
                }
            }
            which_stars_are_green[i] = star;
            if (reveal_neighbourhood)
            {
                foreach (var starix in stars_visible_from(GameDad.manystars.getstar(i).vec))
                {
                    allocate_particle_for_star(starix);
                }
            }
            setparticles_later = true;
        }
    }