public GeneratorData(GeneratorJsonData data, GeneratorType type) { this.Id = data.id; this.Name = data.name; this.BaseCost = data.baseCost; this.IncrementFactor = data.incrementFactor; this.BaseGeneration = data.baseGeneration; this.TimeToGenerate = data.timeToGenerate; //this.CoinPrice = data.coinPrice; this.EnhancePrice = data.enhancePrice; this.ProfitIncrementFactor = data.profitIncrementFactor; this.ManagerIconId = data.managerIcon; this.Type = type; }
public void ReplaceValues(GeneratorJsonData data) { var generator = GetGeneratorData(data.id); generator?.Replace( data.baseCost, data.incrementFactor, data.baseGeneration, data.timeToGenerate, data.enhancePrice, data.profitIncrementFactor); if (generator == null) { Debug.LogError($"generator null when replaced => {data.id}"); } else { Debug.Log($"generator => {data.id} replaced with data increment factor => {data.incrementFactor} on generator increment factor {generator.IncrementFactor}".Colored(ConsoleTextColor.green)); GameEvents.GeneratorDataReplacedSubject.OnNext(generator); } }