159 | | * 'Wall elements' are commonly chosen by strings like 'wall', 'tower', 'gate' etc. (see WallElement class definition for more documentation). |
160 | | * Wall elements are merged in an array that then defines a 'wall' or a 'wall part'. Those walls can then be placed with the functions. |
| 159 | * 'Wall elements' are commonly chosen by strings like 'wall', 'tower', 'gate' etc. (see `WallElement` class definition for more documentation). |
| 160 | * Wall element type strings are merged in an array that then defines a 'wall' or a 'wall part'. Those walls can then be placed with the functions. |
| 161 | * As far as possible (as will be, not as is) wall style and wall element type strings are chosen to fit the entity name "prefix" and "suffix" so that the entities used for this style can be got by: "structures/" + wallStyleString + "_" + wallElementTypeString. |
162 | | * 'placeFortress()': Places a default fortress by it's fortress name string centered at the given coordinates with its entrance facing 'orientation'. |
163 | | * 'placeLinearWall()': Places a wall from start X/Y to target X/Y with repeated usage of the given 'wall part'. |
164 | | * 'placeCircularWall()': Places a wall circle centered at the given coordinates with a given radius and repeated usage of the given 'wall part'. |
165 | | * 'placeWall()': Function to place a simple wall defined by a 'wall' array starting with the first wall element placed as given by coordinates and angle. |
| 163 | * `placeFortress()`: Places a default fortress by it's fortress name string centered at the given coordinates with its entrance facing "orientation". |
| 164 | * `placeLinearWall()`: Places a wall from start X/Y to target X/Y with repeated usage of the given "wall part". |
| 165 | * `placeCircularWall()`: Places a wall circle centered at the given coordinates with a given radius and repeated usage of the given "wall part". |
| 166 | * `placePolygonalWall()`: Places n walls of the same length with the corners on a circle of the given radius centered at the given coordinates. |
| 167 | * `placeIrregularPolygonalWall()`: Places n walls of random length with the corners on a circle of the given radius centered at the given coordinates. |
| 168 | * `placeGenericFortress()`: Place a more generic looking wall around a point (like the Iberian civ bonus) centered at the given coordinates (Work In Progress). |
| 169 | * `placeWall()`: Function to place a simple wall defined by a "wall" array starting with the first wall element placed as given by coordinates and angle. |
167 | | * 'WallElement()': Defines a wall element including its entity and a name string to easily access it. |
168 | | * 'Fortress()': Defines a fortress mainly by its 'wall' and a name string to easily access it. |
169 | | * 'wallStyles': An associative array that holds all default wall styles with the civ strings as keys (like 'cart' or 'celt') or other descriptive strings (like 'palisades' or 'romeSiege'). A wall style itself again is an associative array holding all the default wall elements with their name string as key (like 'wall' or 'tower'). |
170 | | * 'fortressTypes': An associative array that holds all default fortress types by a key that is mainly chosen like the map sizes (like 'tiny' or 'veryLarge'). |
171 | | * 'getWallAlignment()': A function to get a walls 'alignment' that mainly includes everything needed to place all the wall's elements. |
172 | | * 'getWallCenter()': A function to get the 'center of mass' of a wall by giving its 'alignment' and returning the vector from the first element to the center. |
| 171 | * `WallElement()`: Defines a wall element including its entity and a name string to easily access it. |
| 172 | * `Fortress()`: Defines a fortress mainly by its "wall" and a name string to easily access it. |
| 173 | * `wallStyles`: An associative array that holds all default wall styles with the civ strings as keys (like "cart" or "celt") or other descriptive strings (like "palisades" or "rome_siege"). A wall style itself again is an associative array holding all the default wall elements with their name string as key (like "wall" or "tower"). |
| 174 | * `fortressTypes`: An associative array that holds all default fortress types by a key that is mainly chosen like the map sizes (like "tiny" or "veryLarge"). |
| 175 | * `getWallAlignment()`: A function to get a walls "alignment" that mainly includes everything needed to place all the wall's elements. |
| 176 | * `getWallCenter()`: A function to get the "center of mass" of a wall by giving its "alignment" and returning the vector from the first element to the center. |
| 177 | * `getWallLength()`: A function to get the length of a wall or wall part with no overlapping. This doesn't support bending wall elements (see below). |