forked from Azurency/Civ6-UIFiles
-
Notifications
You must be signed in to change notification settings - Fork 1
/
EspionageViewManager.lua
39 lines (33 loc) · 1.42 KB
/
EspionageViewManager.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
-- ===========================================================================
-- Class Table
-- ===========================================================================
EspionageViewManager = {
m_kEspionageViewCity = nil;
}
-- ===========================================================================
-- Static-style initialization functions
-- ===========================================================================
function EspionageViewManager:CreateManager()
local oNewManager:object = {};
setmetatable(oNewManager, {__index = EspionageViewManager });
return oNewManager;
end
-- ===========================================================================
function EspionageViewManager:SetEspionageViewCity( ownerID:number, cityID:number )
local pOwner:table = Players[ownerID];
if pOwner ~= nil then
self.m_kEspionageViewCity = pOwner:GetCities():FindID(cityID);
end
end
-- ===========================================================================
function EspionageViewManager:GetEspionageViewCity()
return self.m_kEspionageViewCity;
end
-- ===========================================================================
function EspionageViewManager:ClearEspionageViewCity()
self.m_kEspionageViewCity = nil;
end
-- ===========================================================================
function EspionageViewManager:IsEspionageView()
return self.m_kEspionageViewCity ~= nil and UI.GetHeadSelectedCity() == nil;
end