Пример #1
0
    private float DifficultyToProduce(ProductionDifficulty difficultyToProduce)
    {
        float productionDifficultyModifier = 0;

        switch (difficultyToProduce)
        {
        case ProductionDifficulty.trivial:
            productionDifficultyModifier = _trivialToProduce;
            break;

        case ProductionDifficulty.easy:
            productionDifficultyModifier = _easyToProduce;
            break;

        case ProductionDifficulty.medium:
            productionDifficultyModifier = _mediumToProduce;
            break;

        case ProductionDifficulty.hard:
            productionDifficultyModifier = _hardToProduce;
            break;
        }

        return(productionDifficultyModifier);
    }
Пример #2
0
    public Resource(int id, string displayName, ResourceUtil.ResourceType type, float basePrice, AgentEntity.EntityType producedBy, ProductionDifficulty difficultyToProduce)
    {
        Id          = id;
        DisplayName = displayName;
        Type        = type;
        BasePrice   = basePrice;
        ProducedBy  = producedBy;

        ProductionDifficultyModifier = DifficultyToProduce(difficultyToProduce);
    }