Skip to content
Snippets Groups Projects
Select Git revision
  • 8adc8a34c082447ca58a5330f6c61f9d39e01e2c
  • main default protected
2 results

server.go

Blame
  • User.java 1.29 KiB
    import java.util.*;
    import java.net.*;
    import java.io.*;
    
    public class User {
    
      private Location location; // location x, y
      private ArrayList<MyDate> calendar = new ArrayList<MyDate>();
      private Path path;
    
      /**
       * User constructor
       * @param x     float, coordinate x
       * @param y     float, coordinate y
       * @param dates ArrayList<MyDate>, table of possible dates
       */
      public User(float x, float y, ArrayList<MyDate> dates) {
        this.location = new Location(x, y);
        this.calendar = dates;
      }
    
      /**
       * Get coordinate of the user
       * @return Location
       */
      public Location get_location(){
        return this.location;
      }
    
      /**
       * Get all possible dates from the user
       * @return ArrayList<MyDate>, table of dates
       */
      public ArrayList<MyDate> get_calendar(){
        return this.calendar;
      }
    
      /**
       * Set locaton coordinate x and y
       * @param x Float, Coordinate x
       * @param y Float, Coordinate y
       */
      public void set_location(float x, float y){
        this.location.set_x(x);
        this.location.set_y(y);
      }
    
      /**
       * Add a Date in the calendar
       * @param date int[]
       * @param from int[]
       * @param to   int[]
       */
      public void add_Date(int[] date, int[] from, int[] to){
        MyDate d = new MyDate(date, from, to);
        this.calendar.add(d);
      }
    
      public void calcul_path(){
    
      }
    
    }