getAllSeeds(); } catch (\Exception $e) { Log::error('获取所有种子失败', [ 'error' => $e->getMessage(), 'trace' => $e->getTraceAsString() ]); return collect(); } } /** * 获取指定类型的种子 * * @param int $type * @return Collection */ public static function getSeedsByType(int $type): Collection { try { $seedLogic = new SeedLogic(); return $seedLogic->getSeedsByType($type); } catch (\Exception $e) { Log::error('获取指定类型种子失败', [ 'type' => $type, 'error' => $e->getMessage(), 'trace' => $e->getTraceAsString() ]); return collect(); } } /** * 获取种子详情 * * @param int $seedId * @return FarmSeed|null */ public static function getSeedDetail(int $seedId): ?FarmSeed { try { $seedLogic = new SeedLogic(); return $seedLogic->getSeedDetail($seedId); } catch (\Exception $e) { Log::error('获取种子详情失败', [ 'seed_id' => $seedId, 'error' => $e->getMessage(), 'trace' => $e->getTraceAsString() ]); return null; } } /** * 获取种子的产出配置 * * @param int $seedId * @return Collection */ public static function getSeedOutputs(int $seedId): Collection { try { $seedLogic = new SeedLogic(); return $seedLogic->getSeedOutputs($seedId); } catch (\Exception $e) { Log::error('获取种子产出配置失败', [ 'seed_id' => $seedId, 'error' => $e->getMessage(), 'trace' => $e->getTraceAsString() ]); return collect(); } } /** * 根据物品ID获取种子 * * @param int $itemId * @return FarmSeed|null */ public static function getSeedByItemId(int $itemId): ?FarmSeed { try { $seedLogic = new SeedLogic(); return $seedLogic->getSeedByItemId($itemId); } catch (\Exception $e) { Log::error('根据物品ID获取种子失败', [ 'item_id' => $itemId, 'error' => $e->getMessage(), 'trace' => $e->getTraceAsString() ]); return null; } } }