dcsex.env.Mission

Represents a mission table.

Contents

  1. Description
  2. Methods
    1. mission:loadfile(zfile)
    2. mission:groupTable(grp, countryID, dcscategory)
    3. mission:processCategory(grplist, cattbl, cntryid, dcscategory, logger)
    4. mission:processCoalition(coatbl, logger)
    5. mission:addZone(zonetbl)
    6. mission:addGroup(grp, countryID, dcscategory)
  3. Metamethods
    1. mission:__init(miztbl, logger)
  4. Tables
    1. mission.categorymap

Description

Handles loading a mission table and provides some common ways of accessing the data. Also provides a class method to extract the mission table from a zip.

Methods

mission:loadfile(zfile)

It is assumed the mission is zip compressed.

Parameters

zfile
string zip compressed file path

Returns

  • a Mission instance ortherwise nil and an error string

mission:groupTable(grp, countryID, dcscategory)

Parameters

grp
the group definition
countryID
the country the group belongs to, will determine which coalition the group belongs to in game
dcscategory
the Unit.Category the group belongs to

Returns

  • a table

mission:processCategory(grplist, cattbl, cntryid, dcscategory, logger)

Parameters

grplist
[output] list of groups found, indexed by group name
cattbl
category table from a mission.coalition table
cntryid
country id
dcscategory
category from Unit.Category
logger
a Logger instance

mission:processCoalition(coatbl, logger)

Parameters

coatbl
coalition table, example env.mission.coalition
logger
reference to an env.Logger instance

Returns

  • table keyed on group names.

mission:addZone(zonetbl)

Parameters

zonetbl
the zone definition to process

mission:addGroup(grp, countryID, dcscategory)

Parameters

grp
the group definition
countryID
the country the group belongs to, will determine which coalition the group belongs to in game
dcscategory
the Unit.Category the group belongs to

Metamethods

mission:__init(miztbl, logger)

Parameters

miztbl
logger

Tables

mission.categorymap

The keys are the mission table entries in lower case and the values map the Unit.Category[] keys.

Parameters

[HELICOPTER]
[SHIP]
[VEHICLE]
[PLANE]
[STATIC]