Esempio n. 1
0
		public static Int32Value Create(Bool3 b) {
			switch (b) {
			case Bool3.False:	return Zero;
			case Bool3.True:	return One;
			default:			return CreateUnknownBool();
			}
		}
Esempio n. 2
0
 public static IntBox OffsetSize(Int3 min, Int3 size, Bool3 maxIsInclusive)
 {
     return(new IntBox(
                new Range(min.X, min.X + size.X, maxIsInclusive.X),
                new Range(min.Y, min.Y + size.Y, maxIsInclusive.Y),
                new Range(min.Z, min.Z + size.Z, maxIsInclusive.Z)
                ));
 }
Esempio n. 3
0
 public static IntBox FromMinAndMax(Int3 min, Int3 max, Bool3 maxIsInclusive)
 {
     return(new IntBox(
                new Range(min.X, max.X, maxIsInclusive.X),
                new Range(min.Y, max.Y, maxIsInclusive.Y),
                new Range(min.Z, max.Z, maxIsInclusive.Z)
                ));
 }
Esempio n. 4
0
 bool EmulateBranch(int stackArgs, Bool3 cond)
 {
     if (cond == Bool3.Unknown)
     {
         return(false);
     }
     return(EmulateBranch(stackArgs, cond == Bool3.True));
 }
        int EmulateBranch(int stackArgs, Bool3 cond, Instruction instrTrue, Instruction instrFalse)
        {
            if (cond == Bool3.Unknown)
            {
                return(-1);
            }
            Instruction instr = cond == Bool3.True ? instrTrue : instrFalse;

            return(methodToInline.Body.Instructions.IndexOf(instr));
        }
        static Int32Value create(Bool3 b)
        {
            switch (b)
            {
            case Bool3.False:       return(Int32Value.zero);

            case Bool3.True:        return(Int32Value.one);

            default:                        return(Int32Value.createUnknownBool());
            }
        }
Esempio n. 7
0
        public override bool Equals(object other)
        {
            if (other == null || GetType() != other.GetType())
            {
                return(false);
            }

            Bool3 o = (Bool3)other;

            return((this == o).allTrue);
        }
Esempio n. 8
0
        static Int32Value Create(Bool3 b)
        {
            switch (b)
            {
            case Bool3.False:       return(Zero);

            case Bool3.True:        return(One);

            default:                        return(CreateUnknownBool());
            }
        }
Esempio n. 9
0
        /// <summary>
        /// Converts a specified Bool3 value to string.
        /// </summary>
        /// <param name="val">The value.</param>
        /// <returns>"false" for False, "true" for True, "" for Any.</returns>
        public static string Bool3ToString(Bool3 val)
        {
            switch (val)
            {
            case Bool3.False:
                return("false");

            case Bool3.True:
                return("true");

            default:
                return("");
            }
        }
Esempio n. 10
0
        public Bool3 DrawElement(WindowSettings window, DrawInfo info, int childCount, string name, float width, Texture tex, string tooltip = "")
        {
            Bool3 clicked = new Bool3();

            if (childCount > 0)
            {
                GUILayout.Space(-1);
                // GUI.color = GUI.backgroundColor;
                clicked.v2 = GUILayout.Button(Helper.GetGUIContent(string.Empty, tooltip), GUILayout.Width(21), GUILayout.Height(21));
                Rect rect = GUILayoutUtility.GetLastRect();
                rect.x    += (info.foldout ? 4 : 5);
                rect.y    += (info.foldout ? 7 : 6);
                rect.width = rect.height = 8;
                GUI.DrawTexture(rect, info.foldout ? texArrowUnfolded : texArrowFolded);
                // GUI.color = GetColor(Color.white);
                GUILayout.Space(-4);
            }
            else
            {
                GUILayout.Space(5);
                DrawDot(GUI.backgroundColor, tooltip, tex);
                GUILayout.Space(5);
                // GUILayout.Toggle(true, Helper.MyGUIContent(string.Empty, tooltip), GUILayout.Width(25));
            }

            GUILayout.Space(2);

            if (width == -1)
            {
                GUILayout.Label(name);
            }
            else
            {
                GUILayout.Label(name, GUILayout.Width(width));
            }

            clicked.v3 = clicked.v1 || clicked.v2;

            return(clicked);
        }
Esempio n. 11
0
        public Bool3 DrawElement(WindowSettings window, DrawInfo info, int childCount, string text = "", Texture image = null, string tooltip = "", bool isActive = true, int prefix = 0)
        {
            Bool3 clicked = new Bool3();

            GUI.color = isActive ? Color.white : new Color(0.25f, 0.25f, 0.25f, 1);

            GUILayout.BeginHorizontal();
            if (prefix != 0)
            {
                GUILayout.Space(prefix);
            }

            if (childCount > 0 || childCount == -1)
            {
                if (windowData.showChildCount.Value && childCount > 0)
                {
                    clicked.v2 = GUILayout.Button((Helper.GetGUIContent(childCount.ToString(), info.foldout ? texArrowUnfolded : texArrowFolded)), GUILayout.Width(55), GUILayout.Height(21));
                }
                else
                {
                    clicked.v2 = GUILayout.Button(Helper.GetGUIContent(string.Empty, info.foldout ? texArrowUnfolded : texArrowFolded), GUILayout.Width(25), GUILayout.Height(21));
                }
            }
            else
            {
                GUILayout.Label(string.Empty, GUILayout.Width(windowData.showChildCount.Value ? 55 : 25), GUILayout.Height(21));
            }

            clicked.v1 = GUILayout.Button(Helper.GetGUIContent(text, image, tooltip), GUILayout.Height(21));

            GUILayout.EndHorizontal();

            GUI.color  = Color.white;
            clicked.v3 = clicked.v1 || clicked.v2;

            return(clicked);
        }
Esempio n. 12
0
		public static Vector3 ReplaceValues(Vector3 current, Vector3 replace, Bool3 mask) {
			return ReplaceValues(current, replace, mask.x, mask.y, mask.z);
		}
Esempio n. 13
0
 public bool Equals(Bool3 other)
 {
     return(this.X == other.X && this.Y == other.Y && this.Z == other.Z);
 }
Esempio n. 14
0
		bool emulateBranch(int stackArgs, Bool3 cond) {
			if (cond == Bool3.Unknown)
				return false;
			return emulateBranch(stackArgs, cond == Bool3.True);
		}
Esempio n. 15
0
 public Bool3Property(string name, Bool3 val)
 {
     Name = name; Value = val;
 }
Esempio n. 16
0
 static Int32Value create(Bool3 b)
 {
     switch (b) {
     case Bool3.False:	return zero;
     case Bool3.True:	return one;
     default:			return createUnknownBool();
     }
 }
Esempio n. 17
0
 public static Box CenterExtent(Vec3 center, float extent, Bool3 maxIsInclusive)
 {
     return(FromMinAndMax(center - extent, center + extent, maxIsInclusive));
 }
Esempio n. 18
0
 static Int32Value create(Bool3 b)
 {
     switch (b) {
     case Bool3.False:	return new Int32Value(0);
     case Bool3.True:	return new Int32Value(1);
     default:			return Int32Value.createUnknownBool();
     }
 }
		bool EmulateBranch(int stackArgs, Bool3 cond) {
			if (cond == Bool3.Unknown)
				return false;
			return EmulateBranch(stackArgs, cond == Bool3.True);
		}
Esempio n. 20
0
 public Bool3Property(Bool3 val)
 {
     Value = val;
 }
		int EmulateBranch(int stackArgs, Bool3 cond, Instruction instrTrue, Instruction instrFalse) {
			if (cond == Bool3.Unknown)
				return -1;
			Instruction instr = cond == Bool3.True ? instrTrue : instrFalse;
			return methodToInline.Body.Instructions.IndexOf(instr);
		}
Esempio n. 22
0
 public void SetValue(Bool3 value)
 {
     Value = value;
 }
Esempio n. 23
0
		public static Int32Value Create(Bool3 b) {
			switch (b) {
			case Bool3.False:	return Zero;
			case Bool3.True:	return One;
			default:			return CreateUnknownBool();
			}
		}
Esempio n. 24
0
 public Bool3Property()
 {
     Value = new Bool3();
 }