public void PerformGoldenAgeTasks()
        {
            if (GoldenAgeCanon.IsCivInGoldenAge(this))
            {
                GoldenAgeCanon.ChangeTurnsOfGoldenAgeForCiv(this, -1);

                if (GoldenAgeCanon.GetTurnsLeftOnGoldenAgeForCiv(this) <= 0)
                {
                    GoldenAgeCanon.StopGoldenAgeForCiv(this);
                }
            }
            else
            {
                int happiness = CivHappinessLogic.GetNetHappinessOfCiv(this);

                GoldenAgeCanon.ChangeGoldenAgeProgressForCiv(this, happiness);

                float progressTowards = GoldenAgeCanon.GetGoldenAgeProgressForCiv(this);
                float progressNeeded  = GoldenAgeCanon.GetNextGoldenAgeCostForCiv(this);

                if (progressTowards >= progressNeeded)
                {
                    GoldenAgeCanon.SetGoldenAgeProgressForCiv(this, 0f);
                    GoldenAgeCanon.StartGoldenAgeForCiv(this, GoldenAgeCanon.GetGoldenAgeLengthForCiv(this));
                }
            }
        }
        private void TryStartGoldenAge(ICivilization civ)
        {
            int goldenAgeDuration = GoldenAgeCanon.GetGoldenAgeLengthForCiv(civ);

            if (GoldenAgeCanon.IsCivInGoldenAge(civ))
            {
                GoldenAgeCanon.ChangeTurnsOfGoldenAgeForCiv(civ, goldenAgeDuration);
            }
            else
            {
                GoldenAgeCanon.StartGoldenAgeForCiv(civ, goldenAgeDuration);
            }
        }
        public void HandleCommandOnUnit(AbilityCommandRequest command, IUnit unit)
        {
            if (CanHandleCommandOnUnit(command, unit))
            {
                var unitOwner = UnitPossessionCanon.GetOwnerOfPossession(unit);

                int ageDuration = int.Parse(command.ArgsToPass[0]);

                if (GoldenAgeCanon.IsCivInGoldenAge(unitOwner))
                {
                    GoldenAgeCanon.ChangeTurnsOfGoldenAgeForCiv(unitOwner, ageDuration);
                }
                else
                {
                    GoldenAgeCanon.StartGoldenAgeForCiv(unitOwner, ageDuration);
                }
            }
            else
            {
                throw new InvalidOperationException("Cannot handle command");
            }
        }