Class engine.Generator
Genric generator
Functions
Gridlist:init ()
Gridlist initializer
Gridlist:add (x, y, data)
Add a new entry to gridlist
Gridlist:remove (x, y)
Remove entry from gridlist
Gridlist:has (x, y)
Check if gridlist has anything at specified coordinates
Gridlist:toList ()
Turn the gridlist into an easily parsed table
Gridlist:count ()
How many items does our gridlist have??
Fields
engine.Generator.Gridlist
Class Gridlist
Methods
engine.Generator:init (zone, map, level, spots)
Init
engine.Generator:generate ()
Override this in your generator
engine.Generator:resolve (c, list, force)
Resolve
engine.Generator:roomMapAddEntity (i, j, type, e, elists)
Add entity to a room of a map
engine.Generator:roomMapRemoveEntities (i, j)
Remove entities in a room from the map (used if a room has to be removed)
engine.Generator:makeGridList ()
Create a new gridlist
Functions
- Gridlist:init ()
- Gridlist initializer
- Gridlist:add (x, y, data)
-
Add a new entry to gridlist
Parameters:
- x number x coordinate
- y number y coordinate
- data
- Gridlist:remove (x, y)
-
Remove entry from gridlist
Parameters:
- x number x coordinate
- y number y coordinate
- Gridlist:has (x, y)
-
Check if gridlist has anything at specified coordinates
Parameters:
- x number x coordinate
- y number y coordinate
- Gridlist:toList ()
-
Turn the gridlist into an easily parsed table
Returns:
-
{{x, y, data}, ...}
- Gridlist:count ()
-
How many items does our gridlist have??
Returns:
-
number
Fields
Methods
- engine.Generator:init (zone, map, level, spots)
-
Init
Parameters:
- engine.Generator:generate ()
- Override this in your generator
- engine.Generator:resolve (c, list, force)
-
Resolve
Parameters:
- c string, table or function a function or table to resolve
- list table list to resolve
- force boolean force the value of c to be used
Returns:
-
nil
Or
-
res
- engine.Generator:roomMapAddEntity (i, j, type, e, elists)
-
Add entity to a room of a map
Parameters:
- engine.Generator:roomMapRemoveEntities (i, j)
-
Remove entities in a room from the map (used if a room has to be removed)
Parameters:
- i x coord
- j y coord
- engine.Generator:makeGridList ()
-
Create a new gridlist
Returns:
-
Gridlist