Skip to content

Instantly share code, notes, and snippets.

@SamuXarick
Created February 15, 2023 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SamuXarick/fec557fc8828ab7818842fbb178460ec to your computer and use it in GitHub Desktop.
Save SamuXarick/fec557fc8828ab7818842fbb178460ec to your computer and use it in GitHub Desktop.
table entries not iterated in the order they were created
tables = null;
constructor() {
tables = {
company_value_table = { id = null, el = array(GSCompany.COMPANY_LAST), val = {}, pct = {} },
most_profitable_vehicle = { id = null, el = array(GSCompany.COMPANY_LAST), val = {}, pct = {} },
name3 = { id = null, el = array(GSCompany.COMPANY_LAST), val = {}, pct = {} },
name4 = { id = null, el = array(GSCompany.COMPANY_LAST), val = {}, pct = {} },
name5 = { id = null, el = array(GSCompany.COMPANY_LAST), val = {}, pct = {} },
name6 = { id = null, el = array(GSCompany.COMPANY_LAST), val = {}, pct = {} },
name7 = { id = null, el = array(GSCompany.COMPANY_LAST), val = {}, pct = {} },
};
for (local c_id = GSCompany.COMPANY_FIRST; c_id < GSCompany.COMPANY_LAST; c_id++) {
local id = 0;
foreach (league_name, league in this.tables) {
GSLog.Info("id = " + id + "league_name = " + league_name);
league.val.rawset(c_id, [ 0, SetText(GSText.STR_MAIN_EMPTY), SetText(GSText.STR_MAIN_EMPTY) ]);
league.pct.rawset(c_id, 0);
id++;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment