The State Metamorphosis
Allows an arcane entity to alter its behavior when its internal elemental state changes.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: State
ARCANUM SCHOOL: Transmutation // Polymorph
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
type elemental-state
Solid
Liquid
Gas
fun react(s: elemental-state) : string
match s
Solid -> "The ice blocks the attack."
Liquid -> "The water flows around the blade."
Gas -> "The mist dissipates and reforms."
pub fun main()
var current := Solid
println(react(current))
current = Liquid
println(react(current))
current = Gas
println(react(current))
Runic Tags:
#koka
#state
#adt
#mutation