Class Game

java.lang.Object
edu.ucsb.cs156.happiercows.entities.Game

@Entity(name="game") public class Game extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    The end date has passed when now is at or after midnight at the end of the last date (i.e. the last date is the last day of play).
    boolean
     
    boolean
    The starting date is the first day of play, and the last date is the last day of play: a game is in progress from midnight (00:00 local time) at the beginning of the starting date, up to (but not including) midnight at the end of the last date.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Game

      public Game()
  • Method Details

    • gameInProgress

      public boolean gameInProgress(LocalDateTime now)
      The starting date is the first day of play, and the last date is the last day of play: a game is in progress from midnight (00:00 local time) at the beginning of the starting date, up to (but not including) midnight at the end of the last date.
      Parameters:
      now - the date/time to check against
      Returns:
      whether the game is in progress at now
    • gameInProgress

      public boolean gameInProgress()
    • endDateHasPassed

      public boolean endDateHasPassed(LocalDateTime now)
      The end date has passed when now is at or after midnight at the end of the last date (i.e. the last date is the last day of play).
      Parameters:
      now - the date/time to check against
      Returns:
      whether the game has ended as of now