horsegen: redesign character template
This commit is contained in:
17
horse/character.kk
Normal file
17
horse/character.kk
Normal file
@@ -0,0 +1,17 @@
|
||||
module horse/character
|
||||
|
||||
import horse/game-id
|
||||
|
||||
pub struct character-detail
|
||||
character-id: character-id
|
||||
name: string
|
||||
|
||||
pub fun detail(
|
||||
c: character-id,
|
||||
?character/show: (character-id) -> string
|
||||
): character-detail
|
||||
Character-detail(c, c.show)
|
||||
|
||||
pub fun character-detail/show(d: character-detail): string
|
||||
val Character-detail(Character-id(id), name) = d
|
||||
name ++ " (ID " ++ id.show ++ ")"
|
||||
Reference in New Issue
Block a user