Пример #1
0
    protected override ResourceTransaction InitialiseCost()
    {
        ResourceTransaction transaction = ResourceTransactionFactory.Create();

        transaction.AddResourceCost(ResourceCostFactory.Create(ResourceType.WOOD, 2500));
        transaction.AddResourceCost(ResourceCostFactory.Create(ResourceType.MAGIC_STONE, 500));

        return(transaction);
    }
    public ResourceTransaction GeneratePayOutTransaction()
    {
        ResourceTransaction transaction = ResourceTransactionFactory.Create();

        foreach (var workerMapEntry in workerCounts)
        {
            ResourceType type       = workerMapEntry.Key;
            int          numWorkers = workerMapEntry.Value;

            ResourceCost cost = ResourceCostFactory.Create(workerMapEntry.Key, numWorkers * resourcesGeneratedPerWorker);
            transaction.AddResourceCost(cost);
        }

        return(transaction);
    }