diff options
| -rw-r--r-- | src/Main.hs | 7 | 
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Main.hs b/src/Main.hs index 8d74def..f608c01 100644 --- a/src/Main.hs +++ b/src/Main.hs  | |||
| @@ -27,6 +27,7 @@ import Data.List | |||
| 27 | 27 | ||
| 28 | import Data.List | 28 | import Data.List | 
| 29 | import Data.Maybe | 29 | import Data.Maybe | 
| 30 | import Data.Bool | ||
| 30 | 31 | ||
| 31 | import Data.Function | 32 | import Data.Function | 
| 32 | 33 | ||
| @@ -67,6 +68,7 @@ main = do | |||
| 67 | , cmd "blur" blur "Focus no entity" | 68 | , cmd "blur" blur "Focus no entity" | 
| 68 | , cmd "remove" remove "Remove the focused entity from the queue" | 69 | , cmd "remove" remove "Remove the focused entity from the queue" | 
| 69 | , cmd "factions" listFactions "List all inhabited factions" | 70 | , cmd "factions" listFactions "List all inhabited factions" | 
| 71 | , cmd "name'" renameFaction "Rename a faction – merge if new name is taken" | ||
| 70 | , cmd "members" listFaction "List all members of a faction" | 72 | , cmd "members" listFaction "List all members of a faction" | 
| 71 | , cmd "align" alignEntity "Align the focused entity to a faction – creating it, if necessary" | 73 | , cmd "align" alignEntity "Align the focused entity to a faction – creating it, if necessary" | 
| 72 | , cmd "name" nameEntity "Name the current entity overriding previous name assignments" | 74 | , cmd "name" nameEntity "Name the current entity overriding previous name assignments" | 
| @@ -195,3 +197,8 @@ entitySeqVal' ident = do | |||
| 195 | Just (entity, sVal) -> do | 197 | Just (entity, sVal) -> do | 
| 196 | (newEntity, view (seqVal . re _Just) -> val) <- evalFormula entity sVal | 198 | (newEntity, view (seqVal . re _Just) -> val) <- evalFormula entity sVal | 
| 197 | gEntities . at ident .= Just (newEntity & set eSeqVal val) | 199 | gEntities . at ident .= Just (newEntity & set eSeqVal val) | 
| 200 | |||
| 201 | renameFaction :: Completable Faction -> Completable Faction -> Sh GameState () | ||
| 202 | renameFaction f1' f2' = withArg (\f1 -> withArg (\f2 -> renameFaction' f1 f2) f2') f1' | ||
| 203 | where | ||
| 204 | renameFaction' f1 f2 = modifying (gEntities . each . eFaction) (\cF -> bool cF f2 $ cF == f1) | ||
