internal bool Synchronize(EsiDataBlueprint blueprint) { var updated = false; if (blueprint == null) { return(false); } this.EsiSynchronized = true; if (_fileSystemBlueprint == null) { _fileSystemBlueprint = FileSystemDataInterface.CreateBlueprint(this.Id); } if (_fileSystemBlueprint.MaterialEfficency != blueprint.MaterialEfficency) { _fileSystemBlueprint.MaterialEfficency = blueprint.MaterialEfficency; if (_eoiBlueprint != null) { _eoiBlueprint.MaterialEfficency = blueprint.MaterialEfficency; } updated = true; } if (_fileSystemBlueprint.TimeEfficency != blueprint.TimeEfficency) { _fileSystemBlueprint.TimeEfficency = blueprint.TimeEfficency; if (_eoiBlueprint != null) { _eoiBlueprint.TimeEfficency = blueprint.TimeEfficency; } updated = true; } if (!this.Owned) { _fileSystemBlueprint.Owned = true; this.Owned = true; if (_eoiBlueprint != null) { _eoiBlueprint.Owned = true; } updated = true; } return(updated); }
private void EoiBlueprint_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == nameof(EoiBlueprint.Private)) { if (_fileSystemBlueprint == null) { _fileSystemBlueprint = FileSystemDataInterface.CreateBlueprint(this.Id); } _fileSystemBlueprint.Private = _eoiBlueprint.Private; } else if (e.PropertyName == nameof(EoiBlueprint.Owned)) { if (_fileSystemBlueprint == null) { _fileSystemBlueprint = FileSystemDataInterface.CreateBlueprint(this.Id); } _fileSystemBlueprint.Owned = _eoiBlueprint.Owned; this.Owned = _eoiBlueprint.Owned; } else if (e.PropertyName == nameof(EoiBlueprint.MaterialEfficency)) { if (_fileSystemBlueprint == null) { _fileSystemBlueprint = FileSystemDataInterface.CreateBlueprint(this.Id); } _fileSystemBlueprint.MaterialEfficency = _eoiBlueprint.MaterialEfficency; BlueprintCalculator.Calculate(this); } else if (e.PropertyName == nameof(EoiBlueprint.TimeEfficency)) { if (_fileSystemBlueprint == null) { _fileSystemBlueprint = FileSystemDataInterface.CreateBlueprint(this.Id); } _fileSystemBlueprint.TimeEfficency = _eoiBlueprint.TimeEfficency; BlueprintCalculator.Calculate(this); } }