Пример #1
0
    // activate soil on slot with different soil
    public void ChangeSoil(Slot slot)
    {
        Plant plant = plants[slot.plantIndex];
        Soil  soil  = SOILS[heldSoilIndex];

        Color c = Color.white;

        switch (soil)
        {
        case Soil.ash:
            c = ashColor;
            break;

        case Soil.bonechar:
            c = boneCharColor;
            break;

        case Soil.dirt:
            c = dirtColor;
            break;

        case Soil.sand:
            c = sandColor;
            break;

        case Soil.tar:
            c = tarColor;
            break;
        }

        plant.ChangeSoil(soil, slot, c);
        heldSoilIndex = -1;
        // TODO: disappear model to represent it being used up
    }