diff options
| author | historia <[not public]> | 2026-07-09 05:27:10 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-09 05:27:10 -0400 |
| commit | c705ae942573984784ef501bf8198f61f5206ddd (patch) | |
| tree | c964066f3a244002bf75cb50a877630f46496f81 /internal/engine/tick.go | |
| parent | 74153c7814fc4cef988066ef04e38731a943bc12 (diff) | |
| download | thehouseoficarus-c705ae942573984784ef501bf8198f61f5206ddd.tar.gz | |
refactor: simplify yaml, remove support for old scalar fields
Diffstat (limited to 'internal/engine/tick.go')
| -rw-r--r-- | internal/engine/tick.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/internal/engine/tick.go b/internal/engine/tick.go index 7a422af..ff1bace 100644 --- a/internal/engine/tick.go +++ b/internal/engine/tick.go @@ -116,3 +116,24 @@ func ToTicks(base float64) int { } return floor } + +func ValuesEqual(a, b any) bool { + ai, aok := NumericValue(a) + bi, bok := NumericValue(b) + if aok && bok { + return ai == bi + } + return a == b +} + +func NumericValue(v any) (float64, bool) { + switch x := v.(type) { + case int: + return float64(x), true + case int64: + return float64(x), true + case float64: + return x, true + } + return 0, false +} |
