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

Vector2 but with bools. More...

Public Member Functions

 CUIBool2 (bool x=false, bool y=false)
 
override string ToString ()
 

Static Public Member Functions

static CUIBool2 Parse (string s)
 

Public Attributes

bool X
 
bool Y
 

Detailed Description

Vector2 but with bools.

Definition at line 16 of file CUIBool2.cs.

Constructor & Destructor Documentation

◆ CUIBool2()

CrabUI.CUIBool2.CUIBool2 ( bool x = false,
bool y = false )

Definition at line 21 of file CUIBool2.cs.

22 {
23 X = x;
24 Y = y;
25 }

Member Function Documentation

◆ Parse()

static CUIBool2 CrabUI.CUIBool2.Parse ( string s)
static

Definition at line 28 of file CUIBool2.cs.

29 {
30 string content = s.Substring(
31 s.IndexOf('[') + 1,
32 s.IndexOf(']') - s.IndexOf('[') - 1
33 );
34
35 var components = content.Split(',').Select(a => a.Trim());
36
37 string sx = components.ElementAtOrDefault(0);
38 string sy = components.ElementAtOrDefault(1);
39
40 bool x = false;
41 bool y = false;
42
43 if (sx != null && sx != "") x = bool.Parse(sx);
44 if (sy != null && sy != "") y = bool.Parse(sy);
45
46 return new CUIBool2(x, y);
47 }

Member Data Documentation

◆ X

bool CrabUI.CUIBool2.X

Definition at line 18 of file CUIBool2.cs.

◆ Y

bool CrabUI.CUIBool2.Y

Definition at line 19 of file CUIBool2.cs.


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