Example #1
0
    public MapChunk(int x, int y, int tier,
                    Enums.MapSize mapSize = Enums.MapSize.SMALL,
                    Enums.MapOrientation mapOrientation = Enums.MapOrientation.Vertical,
                    Enums.MapChunkBiodome biodome       = Enums.MapChunkBiodome.random,
                    Enums.MapChunkWealth mapWealth      = Enums.MapChunkWealth.poorAsFuck)
    {
        _x    = x;
        _y    = y;
        _tier = tier;
        if (biodome == Enums.MapChunkBiodome.random)
        {
            int r = Random.Range(0, 4);
            Debug.Log("Roll " + r);

            _mapBiodome = (Enums.MapChunkBiodome)r;
        }
        else
        {
            _mapBiodome = biodome;
        }
        _mapWealth = mapWealth;

        _mapSize        = mapSize;
        _mapOrientation = mapOrientation;

        Debug.Log("Created (" + _x + " | " + _y + ") T:" + _tier + " with biodome: " + _mapBiodome + " wealth: " + _mapWealth);
    }
Example #2
0
    public MapChunk(int x, int y, int tier,
                    bool randomSize = true,
                    Enums.MapChunkBiodome biodome  = Enums.MapChunkBiodome.random,
                    Enums.MapChunkWealth mapWealth = Enums.MapChunkWealth.poorAsFuck)
    {
        _x    = x;
        _y    = y;
        _tier = tier;
        if (biodome == Enums.MapChunkBiodome.random)
        {
            int r = Random.Range(0, 4);
            Debug.Log("Roll " + r);

            _mapBiodome = (Enums.MapChunkBiodome)r;
        }
        else
        {
            _mapBiodome = biodome;
        }
        _mapWealth = mapWealth;

        _mapSize        = (Enums.MapSize)getRandomSize();
        _mapOrientation = (Enums.MapOrientation)getRandomMapOrientation();

        Debug.Log("Created (" + _x + " | " + _y + ") T:" + _tier + " with biodome: " + _mapBiodome + " wealth: " + _mapWealth);
    }
Example #3
0
 public void SetMapChunk(MapChunk mapChunk)
 {
     x               = mapChunk._x;
     y               = mapChunk._y;
     tier            = mapChunk._tier;
     _mapWealth      = mapChunk._mapWealth;
     _mapBiodome     = mapChunk._mapBiodome;
     _mapSize        = mapChunk._mapSize;
     _mapOrientation = mapChunk._mapOrientation;
 }
Example #4
0
    // Asetetaan sprite atlas, riippuen millainen kenttä halutaan luoda
    public void SetAtlasToUse(Enums.MapChunkBiodome biodome)
    {
        switch (biodome)
        {
        case Enums.MapChunkBiodome.cold:
            _atlasToUse = coldSpriteAtlas;
            break;

        case Enums.MapChunkBiodome.warm:
            _atlasToUse = dirtSpriteAtlas;
            break;

        case Enums.MapChunkBiodome.fossil:
            _atlasToUse = fossilSpriteAtlas;
            break;

        case Enums.MapChunkBiodome.alien:
            _atlasToUse = alienSpriteAtlas;
            break;
        }
    }