/// true, if tasked has been solved; otherwise false. Initialized as not solved.
privatevarsolved:Bool=false
/// true, if this is the final task on a station; otherwise false. Initialized as false. If final task then the task should not be reachable until the other station's task has been solved.
privatevarisFinal:Bool=false
/**
Constructor
Sets name to standard NO_TASKNAME
Sets description to standard NO_DESCRIPTION
Sets solved to false
*/
init(){
self.name="NO_TASKNAME"
self.name="NO_DESCRIPTION"
self.description="NO_DESCRIPTION"
self.solved=false
}
/**
Set a new name.
- Parameter name: new name for the task
*/
publicfuncsetName(name:String){
ifname.count>0{
self.name=name
}
}
/**
Returns the actual value of the name.
- Returns: name of the task
*/
publicfuncgetName()->String{
returnself.name
}
/**
Set a new description.
- Parameter description: the new description for the task.
*/
publicfuncsetDescription(description:String){
ifdescription.count>0{
self.description=description
}
}
/**
Returns the description of the task.
- Returns: description of the task
*/
publicfuncgetDescription()->String{
returnself.description
}
/**
Sets the new value for the task as has been solved (true) or not (false).
- Parameter solved: true, if task has been solved; false otherwise.
*/
publicfuncsetSolved(solved:Bool){
self.solved=solved
}
/**
Returns, if the task has been solved already.
- Returns: True, if task has been solved; false otherwise.
*/
publicfuncisSolved()->Bool{
returnself.solved
}
/**
Sets the task to be the final one (true) or not (false).
- Parameter isFinal: true, if this is the final task; false otherwise.
*/
publicfuncsetFinal(isFinal:Bool){
self.isFinal=isFinal
}
/**
Returns, if this is the final task of the station. (isFinal already reserved by Swift, so other function name was needed).