public CalibrationProgram GetOrCreateCalibrationProgram(Mill mill) { CalibrationProgram calibrationProgram; if (CPRGEid == null) { Logger.Info("cprg eid is creating one for " + this); var character = GetOwnerCharacter; //create item to ram var calibrationProgramDefinition = GetCalibrationTemplateDefinition(); calibrationProgram = (CalibrationProgram)Entity.Factory.CreateWithRandomEID(calibrationProgramDefinition); calibrationProgram.Owner = character.Eid; mill.GetStorage().AddChild(calibrationProgram); // db-be kell csinalni mert a dinamikus felulirja save-nel calibrationProgram.Save(); Logger.Info("cprg created " + calibrationProgram); } else { //load from sql calibrationProgram = (CalibrationProgram)_itemHelper.LoadItemOrThrow((long)CPRGEid); Logger.Info("found and cprg loaded " + calibrationProgram); } return(calibrationProgram); }