LCOV - code coverage report
Current view: top level - aiinput - errors.go Coverage Total Hit
Test: coverage.lcov Lines: 100.0 % 4 4
Test Date: 2026-11-19 00:25:22 Functions: - 0 0

            Line data    Source code
       1              : package aiinput
       2              : 
       3              : import (
       4              :         "fmt"
       5              : 
       6              :         "github.com/mlange-42/ark/ecs"
       7              : )
       8              : 
       9              : // AIError はAI処理に関するエラーを表す。
      10              : // Entity はnilで「エンティティ未設定」を表す。
      11              : type AIError struct {
      12              :         Type    string      // エラーの種類
      13              :         Message string      // エラーメッセージ
      14              :         Entity  *ecs.Entity // 関連するエンティティ。nilは未設定を表す
      15              : }
      16              : 
      17              : // Error はerrorインターフェースを実装する
      18              : func (e *AIError) Error() string {
      19            1 :         if e.Entity != nil {
      20            1 :                 return fmt.Sprintf("AI Error [%s] Entity=%d: %s", e.Type, *e.Entity, e.Message)
      21            1 :         }
      22            1 :         return fmt.Sprintf("AI Error [%s]: %s", e.Type, e.Message)
      23              : }
        

Generated by: LCOV version 2.0-1