Skip to content

Commit

Permalink
Merge pull request nus-cs2113-AY2324S1#13 from Cheezeblokz/Jingxi-Cal…
Browse files Browse the repository at this point in the history
…endar

Jingxi-Calendar
  • Loading branch information
Brian030601 authored Oct 17, 2023
2 parents 1793052 + 20c3a7e commit 5469535
Show file tree
Hide file tree
Showing 11 changed files with 133 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/seedu/duke/calendar/Calendar.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package seedu.duke.calendar;

public class Calendar {
EventStorage eventStorage;
}
4 changes: 4 additions & 0 deletions src/main/java/seedu/duke/calendar/CalendarCommandParser.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package seedu.duke.calendar;

public class CalendarCommandParser {
}
18 changes: 18 additions & 0 deletions src/main/java/seedu/duke/calendar/CalendarManager.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package seedu.duke.calendar;

public class CalendarManager {
Calendar calendar;
CalendarUi calendarUi;
CalendarCommandParser calendarCommandParser;

public CalendarManager() {
calendar = new Calendar();
calendarUi = new CalendarUi();
calendarCommandParser = new CalendarCommandParser();
}

public void start() {

}

}
4 changes: 4 additions & 0 deletions src/main/java/seedu/duke/calendar/CalendarUi.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package seedu.duke.calendar;

public class CalendarUi {
}
49 changes: 49 additions & 0 deletions src/main/java/seedu/duke/calendar/Event.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package seedu.duke.calendar;

import java.time.LocalDate;

public class Event {
String name;
LocalDate from;
LocalDate to;

public Event(String name, LocalDate from, LocalDate to) {
this.name = name;
this.from = from;
this.to = to;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public LocalDate getFrom() {
return from;
}

public void setFrom(LocalDate from) {
this.from = from;
}

public LocalDate getTo() {
return to;
}

public void setTo(LocalDate to) {
this.to = to;
}

@Override
public String toString() {
return "Event{" +
"name='" + name + '\'' +
", from=" + from +
", to=" + to +
'}';
}

}
33 changes: 33 additions & 0 deletions src/main/java/seedu/duke/calendar/EventStorage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package seedu.duke.calendar;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.TreeMap;

public class EventStorage {
ArrayList<Event> events;

public EventStorage() {
events = new ArrayList<>();
}

public void addEvent(String name, LocalDate from, LocalDate to) {
events.add(new Event(name, from, to));
}

public boolean delEvent(String name) {
for(Event event : events) {
if (event.getName().equals(name)) {
events.remove(event);
return true;
}
}
return false;
}
@Override
public String toString() {
return "EventStorage{" +
"events=" + events +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package seedu.duke.calendar.command;

public class AddEventCommand extends EventCommand{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package seedu.duke.calendar.command;

public class DeleteEventCommand extends EventCommand{
}
4 changes: 4 additions & 0 deletions src/main/java/seedu/duke/calendar/command/EventCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package seedu.duke.calendar.command;

public abstract class EventCommand {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package seedu.duke.calendar.command;

public class ListCalendarEventsCommand extends EventCommand{
}
4 changes: 4 additions & 0 deletions src/main/java/seedu/duke/calendar/command/UnknownCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package seedu.duke.calendar.command;

public class UnknownCommand extends EventCommand{
}

0 comments on commit 5469535

Please sign in to comment.