Opened 6 years ago
Closed 6 years ago
#5042 closed enhancement (fixed)
Complete rmgen object-oriented programming paradigm
Reported by: | elexis | Owned by: | |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 23 |
Component: | Maps | Keywords: | |
Cc: | Patch: |
Description
The most powerful feature of random map generation is the createArea
method which consumes a Placer
, Painter
and Constraint
instances.
The methods to determine a geometric shape, constraining that area arbitrarily and doing something arbitrary to that area are well split by logic into prototypes. This way one can combine them like lego.
Since we now have a significant amount of JS prototypes implementing these interfaces, the files should be split per protoype, gaining the advantages of https://en.wikipedia.org/wiki/Information_hiding.
The remaining code would come out nicer too if it would be split into protoypes.
This is a continuation of #4804.
Change History (5)
comment:1 by , 6 years ago
comment:3 by , 6 years ago
comment:5 by , 6 years ago
Milestone: | Backlog → Alpha 23 |
---|---|
Priority: | Should Have → Nice to Have |
Resolution: | → fixed |
Status: | new → closed |
I'm a bit reluctant to split the 11 constraint prototypes having 160 lines into 11 files with 14 lines each. Same for Terrain and Group.
player.js
and the wall builder should likely become a protoype eventually, but aren't part of rmgen anymore.
In 21287: