overlord_event_system/behaviors/arena.rs
1//! Arena rating-change behaviors (code-dispatched by the matchmaking /
2//! fight-result paths).
3
4/// Inputs for a rating-change fn. The shipped behaviors are constants and read
5/// nothing, so this carries nothing; a future rating formula threads the
6/// matchup data in here.
7pub struct RatingChangeCtx;
8
9/// Signature of a rating-change fn (`i64` rating delta).
10pub type RatingChangeFn = fn(&RatingChangeCtx) -> anyhow::Result<i64>;
11
12/// Rating gained on an arena win: a flat 10.
13pub fn win_rating_increase_const(_ctx: &RatingChangeCtx) -> anyhow::Result<i64> {
14 Ok(10)
15}
16
17/// Rating change on an arena loss: a flat -5.
18pub fn lose_rating_increase_const(_ctx: &RatingChangeCtx) -> anyhow::Result<i64> {
19 Ok(-5)
20}