Drag[en]gine Script Module DragonScript  1.21
Dragengine.Gui.Point Class Reference

Immutable 2-component integer point. More...

Inheritance diagram for Dragengine.Gui.Point:

Public Member Functions

Constructors
Point new ()
 Create point with all components set to 0. More...
 
Point new (int x, int y)
 Create point with components. More...
 
Point new (Point point)
 Create copy of a point. More...
 
Operators
Point operator- ()
 Point with each component negated. More...
 
Point operator+ (Point point)
 Sum of two points. More...
 
Point operator- (Point point)
 Difference between two points. More...
 
Point operator* (int scalar)
 Point with each component scaled by a value. More...
 
Point operator/ (int scalar)
 Point with each component divided by a value. More...
 
int operator* (Point point)
 Dot product of two points. More...
 
bool operator< (Point point)
 Check if each component of this point is smaller than another point. More...
 
bool operator<= (Point point)
 Check if each component of this point is smaller than or equal to another point. More...
 
bool operator> (Point point)
 Check if each component of this point is larger than another point. More...
 
bool operator>= (Point point)
 Check if each component of this point is larger than or equal to another point. More...
 

Management

int getX ()
 X component. More...
 
int getY ()
 Y component. More...
 
Point smallest (Point p)
 Point with smallest components of this point and another point. More...
 
Point smallest (int x, int y)
 Point with smallest components of this point and another point. More...
 
Point largest (Point point)
 Point with largest components of this point and another point. More...
 
Point largest (int x, int y)
 Point with largest components of this point and another point. More...
 
Point absolute ()
 Point with absolute value of each component. More...
 
bool isEqualTo (Point point)
 Points are equal. More...
 
bool isAtLeast (int value)
 Both components are larger than or equal to a value. More...
 
bool isAtMost (int value)
 Both components are smaller than or equal to a value. More...
 
bool isZero ()
 Point is equal to zero point. More...
 
Point compMultiply (Point point)
 Multiply with point component wise. More...
 
Point compDivide (Point point)
 Divide by point component wise. More...
 
void writeToFile (FileWriter writer)
 Write point to a file writer. More...
 
bool equals (Object other)
 Point is equal to another object. More...
 
int hashCode ()
 Hash code for use as dictionary keys. More...
 
String toString ()
 String representation of point. More...
 
static Point readFromFile (FileReader reader)
 Read point from a file reader. More...
 

Detailed Description

Immutable 2-component integer point.

This is a native class. It can not be subclassed.

Member Function Documentation

◆ absolute()

Point Dragengine.Gui.Point.absolute ( )

Point with absolute value of each component.

◆ compDivide()

Point Dragengine.Gui.Point.compDivide ( Point  point)

Divide by point component wise.

Exceptions
EDivisionByZeroA component of point is 0.

◆ compMultiply()

Point Dragengine.Gui.Point.compMultiply ( Point  point)

Multiply with point component wise.

◆ equals()

bool Dragengine.Gui.Point.equals ( Object  other)

Point is equal to another object.

Implements Object.equals(Object).

Returns
true if other is of type Point and components are equal.

◆ getX()

int Dragengine.Gui.Point.getX ( )

X component.

◆ getY()

int Dragengine.Gui.Point.getY ( )

Y component.

◆ hashCode()

int Dragengine.Gui.Point.hashCode ( )

Hash code for use as dictionary keys.

Implements Object.hashCode().

◆ isAtLeast()

bool Dragengine.Gui.Point.isAtLeast ( int  value)

Both components are larger than or equal to a value.

◆ isAtMost()

bool Dragengine.Gui.Point.isAtMost ( int  value)

Both components are smaller than or equal to a value.

◆ isEqualTo()

bool Dragengine.Gui.Point.isEqualTo ( Point  point)

Points are equal.

◆ isZero()

bool Dragengine.Gui.Point.isZero ( )

Point is equal to zero point.

◆ largest() [1/2]

Point Dragengine.Gui.Point.largest ( int  x,
int  y 
)

Point with largest components of this point and another point.

◆ largest() [2/2]

Point Dragengine.Gui.Point.largest ( Point  point)

Point with largest components of this point and another point.

◆ new() [1/3]

Point Dragengine.Gui.Point.new ( )

Create point with all components set to 0.

◆ new() [2/3]

Point Dragengine.Gui.Point.new ( int  x,
int  y 
)

Create point with components.

◆ new() [3/3]

Point Dragengine.Gui.Point.new ( Point  point)

Create copy of a point.

◆ operator*() [1/2]

Point Dragengine.Gui.Point.operator* ( int  scalar)

Point with each component scaled by a value.

◆ operator*() [2/2]

int Dragengine.Gui.Point.operator* ( Point  point)

Dot product of two points.

◆ operator+()

Point Dragengine.Gui.Point.operator+ ( Point  point)

Sum of two points.

◆ operator-() [1/2]

Point Dragengine.Gui.Point.operator- ( )

Point with each component negated.

◆ operator-() [2/2]

Point Dragengine.Gui.Point.operator- ( Point  point)

Difference between two points.

◆ operator/()

Point Dragengine.Gui.Point.operator/ ( int  scalar)

Point with each component divided by a value.

Exceptions
EDivisionByZeroscalar is 0.

◆ operator<()

bool Dragengine.Gui.Point.operator< ( Point  point)

Check if each component of this point is smaller than another point.

◆ operator<=()

bool Dragengine.Gui.Point.operator<= ( Point  point)

Check if each component of this point is smaller than or equal to another point.

◆ operator>()

bool Dragengine.Gui.Point.operator> ( Point  point)

Check if each component of this point is larger than another point.

◆ operator>=()

bool Dragengine.Gui.Point.operator>= ( Point  point)

Check if each component of this point is larger than or equal to another point.

◆ readFromFile()

static Point Dragengine.Gui.Point.readFromFile ( FileReader  reader)
static

Read point from a file reader.

◆ smallest() [1/2]

Point Dragengine.Gui.Point.smallest ( int  x,
int  y 
)

Point with smallest components of this point and another point.

◆ smallest() [2/2]

Point Dragengine.Gui.Point.smallest ( Point  p)

Point with smallest components of this point and another point.

◆ toString()

String Dragengine.Gui.Point.toString ( )

String representation of point.

Implements Object.toString()

◆ writeToFile()

void Dragengine.Gui.Point.writeToFile ( FileWriter  writer)

Write point to a file writer.


The documentation for this class was generated from the following file: