spaceconquest.GameScreen.UpdateGalaxy C# (CSharp) Method

UpdateGalaxy() public method

public UpdateGalaxy ( ) : void
return void
        public void UpdateGalaxy()
        {
            statusmenu.Hide();
            SolarSystem3D mousesystem = galaxy.GetMouseOverSystem();
            if (oldmousesystem != null) oldmousesystem.sun.color = oldmousesystem.sun.defaultcolor;
            if (mousesystem != null) { mousesystem.sun.color = Color.Green; telescopemenu.Show(); telescopemenu.Update(mousesystem); }
            else { telescopemenu.Hide(); }

            if ((mousestate.LeftButton == ButtonState.Pressed) && (oldmousestate.LeftButton == ButtonState.Released) && !shipmenu.Contains(mousestate.X, mousestate.Y) && mousesystem != null)
            {
                if (clickedaction == Command.Action.Jump)
                {
                    //commands.Add(new Command(selectedhex, mousesystem.getHex(-2, -2), Command.Action.Jump));
                    space = mousesystem;
                    Boolean occupied = false;
                    foreach (Hex3D h1 in mousesystem.getHexes()) {
                        GameObject o = h1.GetGameObject();
                        if (o != null && o is Unit && ((Unit)o).getAffiliation() == player) {
                            occupied = true;
                            break;
                        }
                    }
                    if (!occupied) {
                        foreach (Hex3D h1 in mousesystem.getHexes()) {
                        h1.visible = false;
                        h1.color = Color.Black;
                        }
                    }

                    //selectedhex = nullhex;
                    clickedaction = Command.Action.Jump;

                }
                else {
                    HashSet<SolarSystem3D> targetable = new HashSet<SolarSystem3D>();
                    foreach (Unit u in player.army) {
                        targetable.Add(u.hex.hexgrid);
                    }
                    if (targetable.Contains(mousesystem)) {
                        space = mousesystem;
                    }

                }
            }

            oldmousesystem = mousesystem;
        }