[+] Encapsulate method to get assignments of specific time

This commit is contained in:
Hykilpikonna
2019-11-06 19:13:45 -05:00
parent 79bb10b14e
commit 3400c07e77
+17
View File
@@ -121,4 +121,21 @@ export default class Course
// Is graded
return true;
}
/**
* Get assignments of the selected time
*/
get assignments(): Assignment[]
{
let timeCode = Navigation.instance.getSelectedTimeCode();
// All year
if (timeCode == -1)
{
return this.rawAssignments;
}
// Specific time
return this.computed.termAssignments[timeCode];
}
}