Skip to content
Snippets Groups Projects
Commit bbe7934e authored by Matti Loimaranta's avatar Matti Loimaranta
Browse files

added max levels to upgrades

parent cf8fab8b
No related branches found
No related tags found
No related merge requests found
......@@ -8,12 +8,7 @@ public class CollectorUpgrade : Upgrade
// Start is called before the first frame update
void Start()
{
UpgradeTargets target = UpgradeTargets.collector;
City city = gameObject.GetComponent<City>();
int currentLevel = city.GetLevel(target);
city.UseResources(GetPrices(currentLevel));
city.AddCollector();
maxLevelModifier = 4;
}
// Update is called once per frame
......@@ -21,4 +16,13 @@ public class CollectorUpgrade : Upgrade
{
}
public void UpgradeCollector()
{
UpgradeTargets target = UpgradeTargets.collector;
City city = gameObject.GetComponent<City>();
int currentLevel = city.GetLevel(target);
city.UseResources(GetPrices(currentLevel));
city.AddCollector();
}
}
......@@ -7,7 +7,7 @@ public class PopulationUpgrade : Upgrade
// Start is called before the first frame update
public void Start()
{
maxLevelModifier = 10;
}
// Update is called once per frame
......
......@@ -7,7 +7,7 @@ public class ResourceCapacityUpgrade : Upgrade
// Start is called before the first frame update
void Start()
{
maxLevelModifier = 4;
}
// Update is called once per frame
......
......@@ -4,10 +4,11 @@ using UnityEngine;
public class RoadUpgrade : Upgrade
{
// Start is called before the first frame update
void Start()
{
maxLevelModifier = 2;
}
// Update is called once per frame
......
......@@ -4,11 +4,8 @@ using UnityEngine;
public abstract class Upgrade : MonoBehaviour
{
/*
private float baseWoodCost = 10;
private float baseStoneCost = 10;
private float baseFoodCost = 10;
*/
protected int maxLevelModifier;
private float efficiencyLevel = 1;
private Dictionary<Resources, int> resources = new Dictionary<Resources, int>();
......
......@@ -3,5 +3,5 @@ using System.Collections.Generic;
using UnityEngine;
public enum UpgradeTargets
{population, capacity, speed, collector}
{population, capacity, speed, collector, city}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment