Anonimo

Modulo:FunzioniGeneriche: differenze tra le versioni

Da Wikitrek.
ShipName function atomized
Nessun oggetto della modifica
(ShipName function atomized)
Riga 222: Riga 222:
--
--
-- @param frame The interface to the parameters passed to {{#invoke:}}
-- @param frame The interface to the parameters passed to {{#invoke:}}
-- @return Bare name- of the ship
-- @return Bare name of the ship
function p.ShipName(frame)
function p.ShipName(frame)
local FullName = frame.args[1]
local FullName = frame.args[1]
return p.ShipNameCore(FullName)
end
--- Extract the name of a ship from its full designation
--
-- @param designation The full designation to process
-- @return Bare name of the ship
function p.ShipNameCore(designation)
local FullName = designation
local Prefixes = {"USS ", "IKS ", "ECS ", "''", "<i>", "</i>"}
local Prefixes = {"USS ", "IKS ", "ECS ", "''", "<i>", "</i>"}