Module:UŊCDSO: Difference between revisions

From Nguhcraft Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
local d = require "Module:Data/UŊCDSO/Countries"
local d = mw.loadJsonData "Data:Places"


local _m = {}
local _m = {}
Line 5: Line 5:
_m.number_ung = function(frame)
_m.number_ung = function(frame)
local count = 0
local count = 0
for _,c in ipairs(d.countries) do
for _, c in ipairs(d.places) do
if c.ung == "MEMBER" then count = count + 1 end
if not c.not_ngation and not c.condominium and not c.reason_dissolved and c.ung == "member" then
count = count + 1
end
end
end
return count
return count
Line 13: Line 15:
_m.number_countries = function(frame)
_m.number_countries = function(frame)
local count = 0
local count = 0
for _,c in ipairs(d.countries) do
for _, c in ipairs(d.places) do
if not c.not_ngation and not c.dissolved and not c.disputed and not c.condominium then
if not c.not_ngation and not c.condominium and not c.reason_dissolved then
count = count + 1
count = count + 1
end
end

Latest revision as of 14:05, 24 May 2026

Documentation for this module may be created at Module:UŊCDSO/doc

local d = mw.loadJsonData "Data:Places"

local _m = {}

_m.number_ung = function(frame)
	local count = 0
	for _, c in ipairs(d.places) do
		if not c.not_ngation and not c.condominium and not c.reason_dissolved and c.ung == "member" then
			count = count + 1
		end
	end
	return count
end

_m.number_countries = function(frame)
	local count = 0
	for _, c in ipairs(d.places) do
		if not c.not_ngation and not c.condominium and not c.reason_dissolved then
			count = count + 1
		end
	end
	return count
end

_m.table_sovereign = function(frame) end

return _m