From 630c7fea50d3a444d9af47b348fa6193fcbbca48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Pirkl?= <pirkl.theo@gmail.com> Date: Sun, 3 Feb 2019 20:07:16 +0100 Subject: [PATCH] Implements events when two people meet --- src/main/java/ch/hepia/events/Meeting.java | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/main/java/ch/hepia/events/Meeting.java diff --git a/src/main/java/ch/hepia/events/Meeting.java b/src/main/java/ch/hepia/events/Meeting.java new file mode 100644 index 0000000..73f5e4c --- /dev/null +++ b/src/main/java/ch/hepia/events/Meeting.java @@ -0,0 +1,49 @@ +package ch.hepia.events; + +import ch.hepia.api.transport.Section; +import ch.hepia.models.User; + +import java.io.Serializable; + +public class Meeting implements Serializable, Event { + private static final long serialVersionUID = 0xAEF34565679L; + private User user; // + private User partner; + private Section section; + + + /** + * Main constructor + * @param userOne The first user to meet the other + * @param userTwo The other user to meet the first one + * @param section The section where both meet each other + */ + public Meeting(User userOne, User userTwo, Section section){ + this.user = userOne; + this.partner = userTwo; + this.section = section; + } + + + @Override + public User getUser() { + return user; + } + + /** + * Gets the user two + * @return The second user + */ + public User getPartner(){ + return partner; + } + + /** + * Gets the section where the two users meet + * @return The section where the two users meet + */ + public Section getSection(){ + return section; + } + +} -- GitLab