| 419 | } |
| 420 | |
| 421 | func snapshotVersionMatchesPython(value any) bool { |
| 422 | switch v := value.(type) { |
| 423 | case int: |
| 424 | return v == SkillRecoverySnapshotVersion |
| 425 | case int64: |
| 426 | return v == SkillRecoverySnapshotVersion |
| 427 | case float64: |
| 428 | return v == SkillRecoverySnapshotVersion |
| 429 | case float32: |
| 430 | return v == SkillRecoverySnapshotVersion |
| 431 | case bool: |
| 432 | if v { |
| 433 | return SkillRecoverySnapshotVersion == 1 |
| 434 | } |
| 435 | return SkillRecoverySnapshotVersion == 0 |
| 436 | default: |
| 437 | return false |
| 438 | } |
| 439 | } |
| 440 | |
| 441 | func floatFromSnapshot(value any) (float64, bool) { |
| 442 | if !snapshotTruthy(value) { |