L-seed-0.1: Plant growing programming game

Lseed.Data

Description

Data definitions for L-seed

Synopsis

Documentation

type UserTag = StringSource

User Tag

type Angle = DoubleSource

Light angle

type Garden a = [Planted a]Source

A list of plants, together with their position in the garden, in the interval [0,1]

type GrowingGarden = Garden GrowthStateSource

Named variants of a garden, for more expressive type signatures

data Planted a Source

A plant with metainformatoin

Constructors

Planted 

Fields

plantPosition :: Double

Position in the garden, interval [0,1]

plantOwner :: Integer

Id of the user that owns this plant

genome :: GrammarFile

Lsystem in use

phenotype :: Plant a

Actual current form of the plant

type GrowingPlanted = Planted GrowthStateSource

Named variants of a Planted, for more expressive type signatures

data Plant a Source

A plant, which is

Constructors

Plant

a stipe with a length (factor of stipeLength), an angle relative to the parent stipe and a list of plants sprouting at the end

Fields

pData :: a
 
pLength :: Double
 
pAngle :: Angle
 
pUserTag :: UserTag
 
pBranches :: [Plant a]
 

data StipeInfo Source

A straight, untagged plant with length zero and no branches.

Constructors

StipeInfo 

Fields

siLength :: Double

a bit redundant, but what shells

siSubLength :: Double
 
siLight :: Double
 
siSubLight :: Double
 
siAngle :: Angle
 
siDirection :: Angle
 
siGrowth :: GrowthState
 
siOffset :: Double

Sideways position, relative to Plant origin

siHeight :: Double

Vertical distance from bottom

Instances

data GrowthState Source

A GrowingPlant can be growing in one of these three ways:

Constructors

NoGrowth 
EnlargingTo Double

value indicates the growth target

GrowingSeed Double

value indicates the current state [0..1]

Instances

type GrowingPlant = Plant GrowthStateSource

Named variants of a Plant, for more expressive type signatures

data ScreenContent Source

Representation of what is on screen

data Observer Source

Main loop observers

Constructors

Observer 

Fields

obInit :: IO ()

Called once, before the main loop starts

obState :: Integer -> GrowingGarden -> IO ()

Called once per tick, with the current tick number and the current state of the garden

obGrowingState :: (ClockTime -> ScreenContent) -> IO ()

Also called once per tick, with a function that calculates the information that should be displayed given a point in time

obFinished :: GrowingGarden -> IO ()

Called before the main loop quits, with the last state of the garden

type GrammarFile = [GrammarRule]Source

A complete grammar file

data GrammarRule Source

A single Rule. For now, only single branches can be matched, not whole subtree structures

data Cmp Source

Constructors

LE 
Less 
Equals 
Greater 
GE 

Instances