Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
G4-SoftEng
Group4-SoftEng
Commits
ad07f9e7
Commit
ad07f9e7
authored
Jun 22, 2021
by
saddamonpc
Browse files
Change strategy variable
parent
fc82964d
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/main/java/softeng/g4/Main.java
View file @
ad07f9e7
...
...
@@ -20,7 +20,7 @@ public class Main {
UserList
userList
;
// --------Uncomment this for the "hardcoded" version.
//
reset();
reset
();
while
(
true
)
{
...
...
src/main/java/softeng/g4/user/Admin.java
View file @
ad07f9e7
...
...
@@ -13,7 +13,7 @@ public class Admin extends User {
this
.
username
=
username
;
this
.
fullname
=
fullname
;
this
.
role
=
"A"
;
this
.
setStrategy
(
new
SeeCalendarCheckPermission
());
this
.
setS
eeCalendarS
trategy
(
new
SeeCalendarCheckPermission
());
// Register new Admin to the userList
userList
.
userList
.
add
(
this
);
...
...
src/main/java/softeng/g4/user/Student.java
View file @
ad07f9e7
package
softeng.g4.user
;
import
softeng.g4.calendar.Calendar
;
import
softeng.g4.calendar.Schedule
;
import
softeng.g4.appointment.Appointment
;
import
softeng.g4.calendar.SeeCalendarWithoutPermission
;
import
java.util.ArrayList
;
public
class
Student
extends
UserStudent
{
// Constructor
...
...
@@ -15,7 +11,7 @@ public class Student extends UserStudent {
this
.
setFullname
(
fullname
);
this
.
setRole
(
"S"
);
this
.
setNPM
(
npm
);
this
.
setStrategy
(
new
SeeCalendarWithoutPermission
());
this
.
setS
eeCalendarS
trategy
(
new
SeeCalendarWithoutPermission
());
// Register new TA to the userList
userList
.
userList
.
add
(
this
);
...
...
src/main/java/softeng/g4/user/TeachingAssistant.java
View file @
ad07f9e7
...
...
@@ -6,8 +6,6 @@ import softeng.g4.course.CourseList;
import
softeng.g4.calendar.Calendar
;
import
softeng.g4.calendar.Schedule
;
import
java.util.ArrayList
;
public
class
TeachingAssistant
extends
UserStudent
{
private
Admin
askPermissionAdmin
=
null
;
private
Calendar
calendar
=
new
Calendar
();
...
...
@@ -18,7 +16,7 @@ public class TeachingAssistant extends UserStudent {
this
.
setFullname
(
fullname
);
this
.
setRole
(
"TA"
);
this
.
setNPM
(
npm
);
this
.
setStrategy
(
new
SeeCalendarWithoutPermission
());
this
.
setS
eeCalendarS
trategy
(
new
SeeCalendarWithoutPermission
());
// Register new TA to the userList
userList
.
userList
.
add
(
this
);
...
...
src/main/java/softeng/g4/user/User.java
View file @
ad07f9e7
...
...
@@ -8,10 +8,10 @@ public abstract class User implements Serializable {
private
String
fullname
;
private
String
username
;
private
String
role
;
private
SeeCalendarStrategy
strategy
;
private
SeeCalendarStrategy
s
eeCalendarS
trategy
;
public
void
seeCalendar
(
String
username
,
UserList
userList
)
{
strategy
.
seeCalendar
(
username
,
userList
);
s
eeCalendarS
trategy
.
seeCalendar
(
username
,
userList
);
}
public
String
getRole
()
{
...
...
@@ -42,7 +42,7 @@ public abstract class User implements Serializable {
return
username
+
" - "
+
fullname
;
}
public
void
setStrategy
(
SeeCalendarStrategy
strategy
)
{
this
.
s
trategy
=
s
trategy
;
public
void
setS
eeCalendarS
trategy
(
SeeCalendarStrategy
s
eeCalendarS
trategy
)
{
this
.
s
eeCalendarStrategy
=
seeCalendarS
trategy
;
}
}
src/main/java/softeng/g4/userlist.txt
View file @
ad07f9e7
No preview for this file type
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment