✨ ARCANUM RUNE DIFFICULTY: Apprentice Behavioral

The State of the Elemental Core

Changing an elemental core's behavior based on its internal attunement.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: State
ARCANUM SCHOOL: Evocation // Elements
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
module State

type element_state = | Solid | Liquid | Gas

let apply_heat (s: element_state) : element_state =
  match s with
  | Solid -> Liquid
  | Liquid -> Gas
  | Gas -> Gas
  
let apply_cold (s: element_state) : element_state =
  match s with
  | Gas -> Liquid
  | Liquid -> Solid
  | Solid -> Solid

Using Algebraic Data Types to model the State pattern, naturally capturing transitions between the elemental states of a magical core.

Runic Tags: #state #elements #transitions