-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTask.ts
More file actions
88 lines (72 loc) · 1.77 KB
/
Task.ts
File metadata and controls
88 lines (72 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import {date} from "./date";
import {Priority} from "./ priority"
export class Task {
/**
* Les propriétées de la classe
*/
private _id : number
private _content : string
private _date : date
private _priority : Priority
private _checked : boolean = false
/**
* Les getters et les setters
*/
get content(): string {
return this._content;
}
get id(): number {
return this._id;
}
set id(value: number) {
this._id = value;
}
set content(value: string) {
this._content = value;
}
get date(): date {
return this._date;
}
set date(value: date) {
this._date = value;
}
get priority(): Priority {
return this._priority;
}
set priority(value: Priority) {
this._priority = value;
}
get checked(): boolean {
return this._checked;
}
set checked(value: boolean) {
this._checked = value;
}
add(contenue : string, date: date, checked :boolean =false, priority : Priority= Priority.Tint){
this._content = contenue
this._date = date
this._checked = checked
return this._id
}
update(content : string, date : date, checked : boolean){
this._content = content
this._date = date
this._checked = checked
}
close(){
this._checked = true
}
/**
* Fonction permettant décrire une tache
*/
toString(){
let data = "CONTENU :" + this._content+ " \n" +
"DATE :" + this.date.toString() + "\n"+
"PRIORITE:" + this._priority + "\n"
if (this._checked)
data += "ETAT: Effectué"
else
data+="ETAT: Non effectué"
return data
}
}