CrabUI
Loading...
Searching...
No Matches
CrabUI.FloatRange Struct Reference

Same as Range but with normal floats. More...

Public Member Functions

float PosOf (float lambda)
 
float LambdaOf (float pos)
 
 FloatRange (float start, float end)
 
override string ToString ()
 

Static Public Member Functions

static bool operator== (FloatRange a, FloatRange b)
 
static bool operator!= (FloatRange a, FloatRange b)
 
static FloatRange Parse (string raw)
 

Public Attributes

float Start
 
float End
 

Static Public Attributes

static FloatRange Zero = new FloatRange(0, 0)
 

Properties

bool IsZero [get]
 
bool IsEmpty [get]
 

Detailed Description

Same as Range but with normal floats.

Definition at line 53 of file Ranges.cs.

Constructor & Destructor Documentation

◆ FloatRange()

CrabUI.FloatRange.FloatRange ( float start,
float end )

Definition at line 63 of file Ranges.cs.

64 {
65 if (end >= start) (Start, End) = (start, end);
66 else (End, Start) = (start, end);
67 }

Member Function Documentation

◆ Parse()

static FloatRange CrabUI.FloatRange.Parse ( string raw)
static

Definition at line 73 of file Ranges.cs.

74 {
75 if (raw == null || raw == "") return new FloatRange(0, 0);
76
77 string content = raw.Split('[', ']')[1];
78
79 List<string> coords = content.Split(',').Select(s => s.Trim()).ToList();
80
81 float start;
82 float end;
83
84 float.TryParse(coords.ElementAtOrDefault(0), out start);
85 float.TryParse(coords.ElementAtOrDefault(1), out end);
86
87 return new FloatRange(start, end);
88 }

Member Data Documentation

◆ End

float CrabUI.FloatRange.End

Definition at line 57 of file Ranges.cs.

◆ Start

float CrabUI.FloatRange.Start

Definition at line 56 of file Ranges.cs.

◆ Zero

FloatRange CrabUI.FloatRange.Zero = new FloatRange(0, 0)
static

Definition at line 55 of file Ranges.cs.

Property Documentation

◆ IsEmpty

bool CrabUI.FloatRange.IsEmpty
get

Definition at line 59 of file Ranges.cs.

◆ IsZero

bool CrabUI.FloatRange.IsZero
get

Definition at line 58 of file Ranges.cs.


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