summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Main.hs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 258e230..e480f4b 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -77,25 +77,26 @@ stateOutline st
77 factionColumn i = [evalState ?? st $ toName x | x <- rowGroup, factionIndex x == i ] 77 factionColumn i = [evalState ?? st $ toName x | x <- rowGroup, factionIndex x == i ]
78 return . colsAllG top $ [show (seqVal' ^. seqVal)] : map factionColumn [0..(length factions - 1)] 78 return . colsAllG top $ [show (seqVal' ^. seqVal)] : map factionColumn [0..(length factions - 1)]
79 79
80listFaction :: Completable Faction -> Sh GameState () 80-- Query state
81listFaction = withArg $ \qFaction -> use gEntities >>= mapM_ (shellPutStrLn <=< toName) . Map.keys . Map.filter ((==) qFaction . view eFaction) 81listFactions, listEntities :: Sh GameState ()
82
83listFactions :: Sh GameState ()
84listFactions = use inhabitedFactions >>= mapM_ (shellPutStrLn . view faction') 82listFactions = use inhabitedFactions >>= mapM_ (shellPutStrLn . view faction')
85
86listEntities :: Sh GameState ()
87listEntities = use (gEntities . to Map.keys) >>= mapM_ (shellPutStrLn <=< toName) 83listEntities = use (gEntities . to Map.keys) >>= mapM_ (shellPutStrLn <=< toName)
88 84
89alignEntity :: Completable Faction -> Sh GameState () 85-- Manage faction
86listFaction, alignEntity :: Completable Faction -> Sh GameState ()
87listFaction = withArg $ \qFaction -> use gEntities >>= mapM_ (shellPutStrLn <=< toName) . Map.keys . Map.filter ((==) qFaction . view eFaction)
90alignEntity = withArg $ \nFaction -> withFocus $ \ident -> gEntities %= Map.adjust (set eFaction nFaction) ident 88alignEntity = withArg $ \nFaction -> withFocus $ \ident -> gEntities %= Map.adjust (set eFaction nFaction) ident
91 89
90-- Automatic focus
92focusTip, blur :: Sh GameState () 91focusTip, blur :: Sh GameState ()
93focusTip = gFocus <~ use tip 92focusTip = gFocus <~ use tip
94blur = gFocus .= Nothing 93blur = gFocus .= Nothing
95 94
95-- Manual focus
96setFocus :: Completable EntityIdentifier -> Sh GameState () 96setFocus :: Completable EntityIdentifier -> Sh GameState ()
97setFocus = withArg $ \ident -> gFocus .= Just ident 97setFocus = withArg $ \ident -> gFocus .= Just ident
98 98
99-- Drop information
99remove :: Sh GameState () 100remove :: Sh GameState ()
100remove = withFocus $ \ident -> do 101remove = withFocus $ \ident -> do
101 name <- toName ident 102 name <- toName ident