Restructuring, #9
This commit is contained in:
		
							parent
							
								
									2055ef234e
								
							
						
					
					
						commit
						dab6fadad4
					
				
					 41 changed files with 941 additions and 680 deletions
				
			
		
							
								
								
									
										67
									
								
								lib/RPGEngine/Data/Default.hs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										67
									
								
								lib/RPGEngine/Data/Default.hs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,67 @@
 | 
			
		|||
module RPGEngine.Data.Default
 | 
			
		||||
-- Everything is exported
 | 
			
		||||
where
 | 
			
		||||
import RPGEngine.Data (Entity (..), Game (..), Item (..), Layout, Player (..), Level (..), StateBase (..), State (..), Physical (..), Direction (..))
 | 
			
		||||
import RPGEngine.Input.Core (ListSelector(..))
 | 
			
		||||
import RPGEngine.Render.LevelSelection (renderLevelSelection)
 | 
			
		||||
import RPGEngine.Input.Playing (spawnPlayer)
 | 
			
		||||
import RPGEngine.Render.Menu (renderMenu)
 | 
			
		||||
 | 
			
		||||
------------------------------ Defaults ------------------------------
 | 
			
		||||
 | 
			
		||||
defaultEntity :: Entity
 | 
			
		||||
defaultEntity = Entity {
 | 
			
		||||
    entityId = "",
 | 
			
		||||
    entityX  = 0,
 | 
			
		||||
    entityY  = 0,
 | 
			
		||||
    entityName = "Default",
 | 
			
		||||
    entityDescription = "",
 | 
			
		||||
    entityActions = [],
 | 
			
		||||
    entityValue   = Prelude.Nothing,
 | 
			
		||||
    entityHp      = Prelude.Nothing,
 | 
			
		||||
    direction     = Stay
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
defaultItem :: Item
 | 
			
		||||
defaultItem = Item {
 | 
			
		||||
    itemId = "",
 | 
			
		||||
    itemX  = 0,
 | 
			
		||||
    itemY  = 0,
 | 
			
		||||
    itemName = "Default",
 | 
			
		||||
    itemDescription = "",
 | 
			
		||||
    itemActions = [],
 | 
			
		||||
    itemValue   = Prelude.Nothing,
 | 
			
		||||
    useTimes    = Prelude.Nothing
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
defaultLayout :: Layout
 | 
			
		||||
defaultLayout = [
 | 
			
		||||
    [Blocked, Blocked, Blocked],
 | 
			
		||||
    [Blocked, Entrance, Blocked],
 | 
			
		||||
    [Blocked, Blocked, Blocked]
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
defaultLevel :: Level
 | 
			
		||||
defaultLevel = Level {
 | 
			
		||||
    layout   = defaultLayout,
 | 
			
		||||
    index    = [
 | 
			
		||||
        (0, 0, Blocked),
 | 
			
		||||
        (0, 1, Blocked),
 | 
			
		||||
        (0, 2, Blocked),
 | 
			
		||||
        (1, 0, Blocked),
 | 
			
		||||
        (1, 1, Entrance),
 | 
			
		||||
        (1, 2, Blocked),
 | 
			
		||||
        (2, 0, Blocked),
 | 
			
		||||
        (2, 1, Blocked),
 | 
			
		||||
        (2, 2, Blocked)
 | 
			
		||||
    ],
 | 
			
		||||
    items    = [],
 | 
			
		||||
    entities = []
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
defaultPlayer :: Player
 | 
			
		||||
defaultPlayer = Player {
 | 
			
		||||
    playerHp  = Prelude.Nothing, -- Compares to infinity
 | 
			
		||||
    inventory = [],
 | 
			
		||||
    position  = (0, 0)
 | 
			
		||||
}
 | 
			
		||||
		Reference in a new issue