Record Class ControlContext
java.lang.Object
java.lang.Record
org.comp2059.pong.controller.ControlContext
-
Constructor Summary
ConstructorsConstructorDescriptionControlContext(double ballCenterY, double paddleCenterY) Creates an instance of aControlContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theballCenterYrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleReturns the value of thepaddleCenterYrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ControlContext
public ControlContext(double ballCenterY, double paddleCenterY) Creates an instance of aControlContextrecord class.- Parameters:
ballCenterY- the value for theballCenterYrecord componentpaddleCenterY- the value for thepaddleCenterYrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
ballCenterY
public double ballCenterY()Returns the value of theballCenterYrecord component.- Returns:
- the value of the
ballCenterYrecord component
-
paddleCenterY
public double paddleCenterY()Returns the value of thepaddleCenterYrecord component.- Returns:
- the value of the
paddleCenterYrecord component
-