Value

This shows all the Value objects and usages.

All of these classes are importable from dofutils.value

Color

class dofutils.value.Color(color1: int, color2: int, color3: int)
property color1: int

Return the first color

Returns:

the first color

Return type:

int

property color2: int

Return the second color

Returns:

the second color

Return type:

int

property color3: int

Return the third color

Returns:

the third color

Return type:

int

colors() list

Return a list containing the colors

Returns:

a list containing the color

Return type:

list

static default() Color

Return a object color with the default color -1 -1 -1

Returns:

Return a default color

Return type:

Color

hex_color_str(separator: str) str

Return a str with the color joined by the separator

Parameters:

separator – The separator between each color

Returns:

A string containing the hexadecimal colors

Return type:

str

hex_colors() list

Return a list containing the colors in a hexadecimal format

Returns:

a list containing the color

Return type:

list

static random() Color

Return a object color with random color

Returns:

Return a random color

Return type:

Color

Dimension

class dofutils.value.Dimension(width: int, height: int)
property height: int

Return the height of the dimension

Returns:

The height

Return type:

int

property width: int

Return the width of the dimension

Returns:

The width

Return type:

int

Interval

class dofutils.value.Interval(min: int, max: int)
amplitude() int

Return the amplitude of the interval (i.e. max - min)

Returns:

the amplitude of the interval

Return type:

int

average() float

Return the average value of the interval (i.e. min + max / 2)

Returns:

the average of the interval

Return type:

float

is_singleton() bool

Check if the current interval is a singleton (i.e. min == max)

Returns:

true if the interval is a singleton, false otherwise

Return type:

bool

property max: int

Return the current max of the interval

Returns:

The max of the interval

Return type:

int

property min: int

Return the current min of the interval

Returns:

The min of the interval

Return type:

int

modify(modifier: int) Interval

Modify the end of the interval The returned interval will be [min, max + modifier] If the new end is lower than the min (i.e. -modifier higher than max - min), the interval [min, min] will be returned

Parameters:

modifier – The modifier value. If positive will increase max, if negative will decrease

Returns:

The new interval

Return type:

Interval

static of(a: int, b: int) Interval

Create a interval with unordered boundary The two boundary will be ordered to create a valid interval

Parameters:
  • a – the first boundary of the interval

  • b – the second boundary of the interval

Returns:

a new Interval instance

Return type:

Interval

Value/Constant

This shows all the Constant value objects and usages.

All of these classes are importable from dofutils.value.constant

Gender

class dofutils.value.constant.Gender(value)

An enumeration.

FEMALE = 1
MALE = 0
static parse(value: Literal['0', '1']) Gender

Get gender from string

Parameters:

value – The string to parse

Returns:

The Gender

Return type:

Gender

Race

class dofutils.value.constant.Race(value)

An enumeration.

CRA = 9
ECAFLIP = 6
ENIRIPSA = 7
ENUTROF = 3
FECA = 1
IOP = 8
NO_CLASS = 0
OSAMODAS = 2
PANDAWA = 12
SACRIEUR = 11
SADIDA = 10
SRAM = 4
XELOR = 5
static by_id(race_id: int) Race

Get the character race by its id

Parameters:

race_id – The race id

Returns:

The race object

Return type:

Race