Add: CompanyGoal class.

This commit is contained in:
Alberth
2014-12-29 09:26:40 +01:00
parent 4201c8f4e7
commit 6771ba0cc1

View File

@@ -1,5 +1,18 @@
// Company related data.
// A goal for a company.
class CompanyGoal {
cid = null;
accept = null;
wanted_amount = null;
constructor(cid, accept, wanted_amount) {
this.cid = cid;
this.accept = accept;
this.wanted_amount = wanted_amount;
}
};
class CompanyData {
cid = null;
@@ -35,7 +48,7 @@ function CompanyData::AddActiveGoal(cargo_id, accept, amount)
{
foreach (num, goal in this.active_goals) {
if (goal == null) {
this.active_goals[num] = {cid=cargo_id, accept=accept, amount=amount};
this.active_goals[num] = CompanyGoal(cargo_id, accept, amount);
break;
}
}