コード例 #1
0
    public static Dictionary <Pos, ILocation> MakeLocationsForExodusFromMethod(BiomeInitialization biomeInit, ExodusGame game, MapGen mapGen, int numCats)
    {
        IMap map = game.map;
        Dictionary <Pos, ILocation> locations = new Dictionary <Pos, ILocation>();

        float[][,] biomes = ExodusBiomeInitializer.GetBiomesFromMethod(map, mapGen, numCats, biomeInit);

        Color[] colorList = Colors.ColorListProcedural(2000);
        for (int x = 0; x < map.xDim; x++)
        {
            for (int y = 0; y < map.yDim; y++)
            {
                Pos     p          = map.pathMap[new Loc(x, y).key()];
                float[] thisBiomes = new float[numCats];
                for (int iCat = 0; iCat < numCats; iCat++)
                {
                    thisBiomes[iCat] = biomes[iCat][x, y];
                }
                Dictionary <string, float> qualities = mapGen.GetLocationQualities(x, y);
                locations[p] = new ExodusLocation(p, thisBiomes, game, qualities);
            }
        }

        return(locations);
    }
コード例 #2
0
    public Color GetColor(ExodusLocation location, Color currentColor)
    {
        Color c = currentColor;

        switch (_currentColorType)
        {
        case ExodusLocationColorType.DiscreteSingle:
            c = GetColorDiscreteSingleBiome(c, location);
            break;

        case ExodusLocationColorType.DiscreteMulti:
            c = GetColorDiscreteManyBiome(c, location);
            break;

        case ExodusLocationColorType.ContinuousSingle:
            c = GetColorContinuousSingleBiome(c, location);
            break;

        case ExodusLocationColorType.ContinuousMulti:
            c = GetColorContinuousManyBiome(c, location);
            break;
        }

        return(c);
    }
コード例 #3
0
    public Color GetColor(ExodusLocation exodusLocation)
    {
        Color c = SetDefaultColor(exodusLocation);

        c = _biomeSystem.GetColor(exodusLocation, c);
        return(c);
    }
コード例 #4
0
    private Color GetColorDiscreteSingleBiome(Color currentColor, ExodusLocation location)
    {
        if (location._biomes[_currentBiome] > ExodusSettings.biomeCutoffDiscrete)
        {
            currentColor = _biomeColors[_currentBiome];
        }

        return(currentColor);
    }
コード例 #5
0
    private Color GetColorContinuousSingleBiome(Color currentColor, ExodusLocation location)
    {
        if (location._biomes[_currentBiome] > ExodusSettings.biomeCutoffContinuous)
        {
            Color pureColor = _biomeColors[_currentBiome];
            currentColor = MapColor.GetColorLerp(location._biomes[_currentBiome], Color.white, pureColor);
        }

        return(currentColor);
    }
コード例 #6
0
    private Color GetColorDiscreteManyBiome(Color currentColor, ExodusLocation location)
    {
        int maxIndex = location.GetMaxBiome();

        if (location._biomes[maxIndex] > ExodusSettings.biomeCutoffDiscrete)
        {
            currentColor = _biomeColors[maxIndex];
        }
        return(currentColor);
    }
コード例 #7
0
    private Color GetColorContinuousManyBiome(Color currentColor, ExodusLocation location)
    {
        int maxIndex = location.GetMaxBiome();

        if (location._biomes[maxIndex] > ExodusSettings.biomeCutoffContinuous)
        {
            Color pureColor = _biomeColors[maxIndex];
            currentColor = MapColor.GetColorLerp(location._biomes[maxIndex], Color.white, pureColor);
        }

        return(currentColor);
    }
コード例 #8
0
    private Color SetDefaultColor(ExodusLocation location)
    {
        Color c = Color.magenta;

        if (location._qualities["Land"] == 0f)
        {
            c = Color.black;
        }
        else
        {
            c = Color.white;
        }
        return(c);
    }
コード例 #9
0
    public static Dictionary <Pos, ILocation> MakeLocationsForExodus(ExodusGame game, MapGen mapGen, int numCats, float cutoff = 0.9f)
    {
        IMap map = game.map;
        Dictionary <Pos, ILocation> locations = new Dictionary <Pos, ILocation>();

        for (int x = 0; x < map.xDim; x++)
        {
            for (int y = 0; y < map.yDim; y++)
            {
                Pos p = map.pathMap[new Loc(x, y).key()];
                Dictionary <string, float> qualities = mapGen.GetLocationQualities(x, y);
                locations[p] = new ExodusLocation(p, new float[numCats], game, qualities);
            }
        }

        return(locations);
    }
コード例 #10
0
 public ExodusStructure(ExodusLocation location)
 {
     _location = location;
     Debug.Log("Made New Structure");
 }