public void UpdateUnit(Unit unit)
        {
            double baseCost = CalculateBaseCost(unit);
            int level = CalculateLevel(baseCost);
            int finalCost = CalculateFinalCost(baseCost, unit.Size, level);

            unit.Cost = finalCost;
            unit.Level = level;
        }
        public bool ValidateUnit(Unit unit)
        {
            foreach (var trait in unit.Traits)
            {
                foreach (var requisite in trait.BaseTrait.Requisites)
                {
                    if (!requisite.Satisfied(unit))
                    {
                        return false;
                    }
                }
            }

            return true;
        }
        private double CalculateBaseCost(Unit unit)
        {
            double baseCost = 0;

            baseCost += CalculateAttributeCost(unit.Movement, costs.MovementCost);
            baseCost += CalculateAttributeCost(unit.MeleeAttack, costs.MeleeAttackCost);
            baseCost += CalculateAttributeCost(unit.MeleeDamage, costs.MeleeDamageCost);
            baseCost += CalculateAttributeCost(unit.RangedAttack, costs.RangedAttackCost);
            baseCost += CalculateAttributeCost(unit.RangedDamage, costs.RangedDamageCost);
            baseCost += CalculateAttributeCost(unit.Defense, costs.DefenseCost);
            baseCost += CalculateAttributeCost(unit.Armor, costs.ArmorCost);
            baseCost += CalculateAttributeCost(unit.Morale, costs.MoraleCost);
            baseCost += CalculateAttributeCost(unit.Leadership, costs.LeadershipCost);
            baseCost += unit.Traits.Sum(t => t.Cost);

            return baseCost;
        }