Skip to content

Commit 3e9fccb

Browse files
committed
chore: 重みをfloat64に統一する
1 parent c47d17d commit 3e9fccb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/dungeon/definition.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ type Definition struct {
1414
// PlannerWeight はマップ種類と出現重みのペアを表す
1515
type PlannerWeight struct {
1616
PlannerType mapplanner.PlannerType
17-
Weight int
17+
Weight float64
1818
}

internal/dungeon/selector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func SelectPlanner(def Definition, rng *rand.Rand) (mapplanner.PlannerType, erro
1616

1717
result, err := raw.SelectByWeightFunc(
1818
def.PlannerPool,
19-
func(pw PlannerWeight) float64 { return float64(pw.Weight) },
19+
func(pw PlannerWeight) float64 { return pw.Weight },
2020
func(pw PlannerWeight) mapplanner.PlannerType { return pw.PlannerType },
2121
rng,
2222
)

0 commit comments

Comments
 (0)