Events.SerialEventRoadDestroyed (Civ5 API)

From Civilization Modding Wiki
Jump to navigationJump to search

This page is a part of the Lua and UI Reference (Civ5).


Function.png This function is a member of Events.

This is a static method, invoke it with a dot.


This event is triggered whenever a route is removed (triggers on railroads despite the name). Does not trigger when pillaging, only for the worker action


Usage

void Events.SerialEventRoadDestroyed(int hexX, int hexY)


Event Type

Regular event: you can subscribe to it through Events.SerialEventRoadDestroyed.Add(<function handler>) or invoke it directly through Events.SerialEventRoadDestroyed(<arguments list>).

Parameters

hexX: Hex x-coordinate of the tile the road was destroyed on which can be converted to map grid coordinates with the ToGridFromHex function
hexY: Hex y-coordinate of the tile the road was destroyed on which can be converted to map grid coordinates with the ToGridFromHex function


Source code samples

DebugMode.lua

UI/InGame/DebugMode.lua
0426
Events.SerialEventRoadDestroyed( g_iHexX, g_iHexY );



The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.