ClassLuaTerritory
Members
| destroy() | Immediately destroys the territory, along with any segmented units guarding it. [...] | |
Immediately destroys the territory, along with any segmented units guarding it. [...] | ||
| get_chunks() | → array[ChunkPositionAndArea] | Gets all chunks that are a part of the territory. [...] |
Gets all chunks that are a part of the territory. [...] | ||
| get_segmented_units() | → array[LuaSegmentedUnit] | Gets the LuaSegmentedUnits that guard this territory. |
Gets the LuaSegmentedUnits that guard this territory. | ||
| regenerate_segmented_units() | Regenerates any segmented units that were created when the territory was generated by the map generator. [...] | |
Regenerates any segmented units that were created when the territory was generated by the map generator. [...] | ||
| regenerate_patrol_path() | Regenerates the patrol path for the territory according to the game's default territory generation algorithm and overwrites the territory's current patrol path. | |
Regenerates the patrol path for the territory according to the game's default territory generation algorithm and overwrites the territory's current patrol path. | ||
| get_patrol_path() | → array[MapPosition] | Get the path that the territory's units follow when patrolling the territory. [...] |
Get the path that the territory's units follow when patrolling the territory. [...] | ||
| set_patrol_path(patrol_path) | Overwrite the territory patrol path for units that guard the territory. [...] | |
Overwrite the territory patrol path for units that guard the territory. [...] | ||
| surface | :: R LuaSurface | The surface on which this territory is located. |
The surface on which this territory is located. | ||
| valid | :: R boolean | Is this object valid? [...] |
Is this object valid? [...] | ||
| object_name | :: R string | The class name of this object. [...] |
The class name of this object. [...] | ||
Methods
get_chunks() → array[ChunkPositionAndArea]
get_segmented_units() → array[LuaSegmentedUnit]
regenerate_segmented_units()
Raised events
| on_segmented_unit_created? instantly | Raised for each segmented unit successfully created. cause will be set to map_generated. |
get_patrol_path() → array[MapPosition]
set_patrol_path(patrol_path)
Parameters
| patrol_path | :: array[MapPosition] | The new patrol path for the territory. Must not be empty. |
The new patrol path for the territory. Must not be empty. | ||

