Advanced Software Engineering
Advanced_Software_Engineering.Verbs.Value.ExpressionValue Class Reference

Expression values are used when there are two IValues that need to be added or subtracted or anything from each other. More...

Inheritance diagram for Advanced_Software_Engineering.Verbs.Value.ExpressionValue:
Advanced_Software_Engineering.Verbs.Value.IValue

Public Member Functions

 ExpressionValue (IValue variable1, IValue variable2, int operation)
 Create a new Expression Value based on the two IValues More...
 
 ExpressionValue (IValue variable1, IValue variable2, string operation)
 Create a new Expression Value based on the two IValues More...
 
string GetDescription ()
 Describes the expression More...
 
string GetOriginalType ()
 Get the type of the expression More...
 
bool IsInitialised ()
 Expressions are always initialised More...
 
bool ToBool ()
 Gets the bool of the result More...
 
Color ToColor ()
 Gets the color of the result More...
 
double ToDouble ()
 Gets the double value of the result More...
 
int ToInt ()
 Gets the int of the result More...
 
IValue Clone ()
 Clones the value of the result More...
 

Static Public Attributes

const int ADD = 0
 An operation denoting addition More...
 
const int SUBTRACT = 1
 An operation denoting subtraction More...
 
const int MULTIPLY = 2
 An operation denoting multiplication More...
 
const int DIVIDE = 3
 An operation denoting division More...
 

Detailed Description

Expression values are used when there are two IValues that need to be added or subtracted or anything from each other.

Constructor & Destructor Documentation

◆ ExpressionValue() [1/2]

Advanced_Software_Engineering.Verbs.Value.ExpressionValue.ExpressionValue ( IValue  variable1,
IValue  variable2,
int  operation 
)

Create a new Expression Value based on the two IValues

Parameters
variable1IValue to perform the operation on
variable2IValue to perform the operation on
operationThe operation. Can be ADD, SUBTRACT, MULTIPLY or DIVIDE.

◆ ExpressionValue() [2/2]

Advanced_Software_Engineering.Verbs.Value.ExpressionValue.ExpressionValue ( IValue  variable1,
IValue  variable2,
string  operation 
)

Create a new Expression Value based on the two IValues

Parameters
variable1IValue to perform the operation on
variable2IValue to perform the operation on
operationThe operation. Can be "+"(ADD), "-"(SUBTRACT), "*"(MULTIPLY) or "/"(DIVIDE).

Member Function Documentation

◆ Clone()

IValue Advanced_Software_Engineering.Verbs.Value.ExpressionValue.Clone ( )

Clones the value of the result

Returns
A new IValue

Implements Advanced_Software_Engineering.Verbs.Value.IValue.

◆ GetDescription()

string Advanced_Software_Engineering.Verbs.Value.ExpressionValue.GetDescription ( )

Describes the expression

Returns
A string description of the expression

Implements Advanced_Software_Engineering.Verbs.Value.IValue.

◆ GetOriginalType()

string Advanced_Software_Engineering.Verbs.Value.ExpressionValue.GetOriginalType ( )

Get the type of the expression

Returns
"expression"

Implements Advanced_Software_Engineering.Verbs.Value.IValue.

◆ IsInitialised()

bool Advanced_Software_Engineering.Verbs.Value.ExpressionValue.IsInitialised ( )

Expressions are always initialised

Returns
true

Implements Advanced_Software_Engineering.Verbs.Value.IValue.

◆ ToBool()

bool Advanced_Software_Engineering.Verbs.Value.ExpressionValue.ToBool ( )

Gets the bool of the result

Returns
bool value of the result

Implements Advanced_Software_Engineering.Verbs.Value.IValue.

◆ ToColor()

Color Advanced_Software_Engineering.Verbs.Value.ExpressionValue.ToColor ( )

Gets the color of the result

Returns
color value of the result

Implements Advanced_Software_Engineering.Verbs.Value.IValue.

◆ ToDouble()

double Advanced_Software_Engineering.Verbs.Value.ExpressionValue.ToDouble ( )

Gets the double value of the result

Returns
double value of the result

Implements Advanced_Software_Engineering.Verbs.Value.IValue.

◆ ToInt()

int Advanced_Software_Engineering.Verbs.Value.ExpressionValue.ToInt ( )

Gets the int of the result

Returns
int value of the result

Implements Advanced_Software_Engineering.Verbs.Value.IValue.

Member Data Documentation

◆ ADD

const int Advanced_Software_Engineering.Verbs.Value.ExpressionValue.ADD = 0
static

An operation denoting addition

◆ DIVIDE

const int Advanced_Software_Engineering.Verbs.Value.ExpressionValue.DIVIDE = 3
static

An operation denoting division

◆ MULTIPLY

const int Advanced_Software_Engineering.Verbs.Value.ExpressionValue.MULTIPLY = 2
static

An operation denoting multiplication

◆ SUBTRACT

const int Advanced_Software_Engineering.Verbs.Value.ExpressionValue.SUBTRACT = 1
static

An operation denoting subtraction


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