コード例 #1
0
ファイル: Modifier.cs プロジェクト: HouseCat-01/Comrade2020
    public void ProcessText(string effects)
    {
        string[] list = continuous.Split(';');
        for (int i = 0; i < list.Length; i++)
        {
            string[] effect = list[i].Trim().Split('=');
            switch (effect[0])
            {
            case "unity":
                ResourceManager.AddUnity(int.Parse(effect[1], NumberStyles.AllowLeadingSign));
                break;

            case "trust":
                ResourceManager.AddTrust(int.Parse(effect[1], NumberStyles.AllowLeadingSign));
                break;

            case "unrest":
                ResourceManager.AddUnrest(int.Parse(effect[1], NumberStyles.AllowLeadingSign));
                break;

            case "unrestChange":
                ResourceManager.AddUnrestChange(int.Parse(effect[1], NumberStyles.AllowLeadingSign));
                break;

            case "population":
                ResourceManager.AddPopulation(int.Parse(effect[1], NumberStyles.AllowLeadingSign));
                break;

            case "food":
                ResourceManager.AddFood(int.Parse(effect[1], NumberStyles.AllowLeadingSign));
                break;

            case "materials":
                ResourceManager.AddMaterials(int.Parse(effect[1], NumberStyles.AllowLeadingSign));
                break;

            case "machinery":
                ResourceManager.AddMachinery(int.Parse(effect[1], NumberStyles.AllowLeadingSign));
                break;

            case "foodIncome":
                ResourceManager.AddFoodIncome(int.Parse(effect[1], NumberStyles.AllowLeadingSign));
                break;

            case "materialsIncome":
                ResourceManager.AddMaterialsIncome(int.Parse(effect[1], NumberStyles.AllowLeadingSign));
                break;

            case "machineryIncome":
                ResourceManager.AddMachineryIncome(int.Parse(effect[1], NumberStyles.AllowLeadingSign));
                break;
            }
        }
    }
コード例 #2
0
ファイル: TextTest.cs プロジェクト: HouseCat-01/Comrade2020
 public void FoodTest()
 {
     ResourceManager.AddFood(10);
 }
コード例 #3
0
    void ResolveOutcome()
    {
        switch (currentOutcome.OutcomeType)
        {
        case (OutcomeEnum.AddEquipment):
            resourceManager.AddEquipment(currentOutcome.OutcomeNumber);
            break;

        case (OutcomeEnum.AddFood):
            resourceManager.AddFood(currentOutcome.OutcomeNumber);
            break;

        case (OutcomeEnum.AddGold):
            resourceManager.AddGold(currentOutcome.OutcomeNumber);
            break;

        case (OutcomeEnum.AllStopWorking):
            workerManager.RemoveFarmer(farmers);
            workerManager.RemoveMerchant(merchants);
            workerManager.RemoveBlacksmith(blacksmiths);
            workerManager.RemoveSoldier(soldiers);
            break;

        case (OutcomeEnum.BlacksmithDie):
            workerManager.RemoveBlacksmith(currentOutcome.OutcomeNumber);
            workerManager.DecreasePopulation(currentOutcome.OutcomeNumber);
            break;

        case (OutcomeEnum.DecreasePop):
            workerManager.DecreasePopulation(currentOutcome.OutcomeNumber);
            break;

        case (OutcomeEnum.FarmerDie):
            workerManager.RemoveFarmer(currentOutcome.OutcomeNumber);
            workerManager.DecreasePopulation(currentOutcome.OutcomeNumber);
            break;

        case (OutcomeEnum.IdleDie):
            workerManager.DecreasePopulation(idle);
            break;

        case (OutcomeEnum.IncreasePop):
            workerManager.IncreasePopulation(currentOutcome.OutcomeNumber);
            break;

        case (OutcomeEnum.MerchantDie):
            workerManager.RemoveMerchant(currentOutcome.OutcomeNumber);
            workerManager.DecreasePopulation(currentOutcome.OutcomeNumber);
            break;

        case (OutcomeEnum.RemoveBlacksmith):
            workerManager.RemoveBlacksmith(currentOutcome.OutcomeNumber);
            workerManager.DecreasePopulation(currentOutcome.OutcomeNumber);
            break;

        case (OutcomeEnum.RemoveEquipment):
            resourceManager.RemoveEquipment(currentOutcome.OutcomeNumber);
            break;

        case (OutcomeEnum.RemoveFarmer):
            workerManager.RemoveFarmer(currentOutcome.OutcomeNumber);
            break;

        case (OutcomeEnum.RemoveFood):
            resourceManager.RemoveFood(currentOutcome.OutcomeNumber);
            break;

        case (OutcomeEnum.RemoveGold):
            resourceManager.RemoveGold(currentOutcome.OutcomeNumber);
            break;

        case (OutcomeEnum.RemoveMerchant):
            workerManager.RemoveMerchant(currentOutcome.OutcomeNumber);
            break;

        case (OutcomeEnum.RemoveSoldier):
            workerManager.RemoveSoldier(currentOutcome.OutcomeNumber);
            break;

        case (OutcomeEnum.SoldierDie):
            workerManager.RemoveSoldier(currentOutcome.OutcomeNumber);
            workerManager.DecreasePopulation(currentOutcome.OutcomeNumber);
            break;

        default:
            return;
        }
    }
コード例 #4
0
 public void GatherResources()
 {
     resource.AddFood(20);
 }