Exemple #1
0
    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        registry = new Registry();
        PrimitiveResources.Register(registry);
        weltschmerz = new Weltschmerz();
        Config config = weltschmerz.GetConfig();

        config.elevation.max_elevation = MAX_ELEVATION;
        config.elevation.min_elevation = MIN_ELEVATION;
        config.map.latitude            = LATITUDE;
        config.map.longitude           = LONGITUDE;

        if (LONGITUDE < 2)
        {
            LONGITUDE = 2;
        }

        if (LATITUDE < 2)
        {
            LATITUDE = 2;
        }

        if (MAX_ELEVATION < 2)
        {
            MAX_ELEVATION = 2;
        }

        Position boundries = new Position();

        boundries.x = LONGITUDE;
        boundries.y = MAX_ELEVATION;
        boundries.z = LATITUDE;

        terra = new Terra(boundries, this);
        GodotSemaphore semaphore1 = new GodotSemaphore();
        GodotSemaphore semaphore2 = new GodotSemaphore();

        foreman = new Foreman(weltschmerz, registry, terra, LOAD_RADIUS);

        GameClient  client = (GameClient)FindNode("GameClient");
        GodotMesher mesher = (GodotMesher)FindNode("GameMesher");

        mesher.SetRegistry(registry);
        client.AddServer(this, mesher);
    }