Unit.GetID (Civ5 API)

From Civilization Modding Wiki
Revision as of 12:57, 20 September 2012 by DonQuich (talk | contribs) (Bot update)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 Unit.

This is an instance method, invoke it with a colon.


Usage

UnitID Unit:GetID()


Returned Value

No description available.


Source code samples

Redundant occurences have been removed.

InGame.lua

UI/InGame/InGame.lua
0204
Data3 = pUnit:GetID();
0517
Events.ShowMovementRange( iPlayerID, unit:GetID() );
0619
Events.ShowAttackTargets(iPlayerID, unit:GetID());
0964
unit:GetID() == unitId and


MilitaryOverview.lua

UI/InGame/Popups/MilitaryOverview.lua
0070
pSelectedUnit:GetID() == unitID ) then
0136
iSelectedUnit = pSelectedUnit:GetID();
0145
local iUnit = unit:GetID();
0159
instance.Button:SetVoid1( unit:GetID() );


PlotMouseoverInclude.lua

UI/InGame/PlotMouseoverInclude.lua
0294
strUnitText = strUnitText .. " ("..tostring(unit:GetOwner()).." - " .. tostring(unit:GetID()) .. ")";


SetUnitName.lua

UI/InGame/Popups/SetUnitName.lua
0019
Network.SendRenameUnit(pUnit:GetID(), Controls.EditUnitName:GetText());


TutorialChecks.lua

Tutorial/TutorialChecks.lua
0202
return v:GetID();
0460
iWorkerID = v:GetID();
0587
iUnitID = v:GetID();
2487
return unit:GetID();


UnitFlagManager.lua

UI/InGame/UnitFlagManager.lua
0596
if( test ~= nil and test:GetID() ~= self.m_UnitID and not test:IsGarrisoned() )
0616
local escortFlag = playerTable[ escortUnit:GetID() ];
0716
controlTable.Button:SetVoids( self.m_playerID, pPlotUnit:GetID() );
1069
controlTable.Button:SetVoids( pPlotUnit:GetOwner(), pPlotUnit:GetID() );
1264
local owner, unitID = unit:GetOwner(), unit:GetID();
1412
OnUnitCreated( player:GetID(), unit:GetID(), 0, 0, 0, 0, 0, 0, 0, WhiteFog, 0, 0, true );
1449
local pFlag = playerTable[ pUnit:GetID() ];


UnitFlagManager.lua (G&K)

DLC/Expansion/UI/InGame/UnitFlagManager.lua
0595
if( test ~= nil and test:GetID() ~= self.m_UnitID and not test:IsGarrisoned() and not test:IsDead() and not test:IsDelayedDeath() )


UnitList.lua

UI/InGame/UnitList.lua
0285
valueA = entryA.unit:GetID();
0286
valueB = entryB.unit:GetID();


UnitPanel.lua

UI/InGame/WorldView/UnitPanel.lua
0739
local unitID = unit and unit:GetID() or -1;
0825
Data1 = UI.GetHeadSelectedUnit():GetID(),



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.