Example #1
0
        public void Print_WithHeightTwo_PrintTwoAsterisksTwoRows()
        {
            using (StringWriter sw = new StringWriter())
            {
                Console.SetOut(sw);
                CrossBuilder cross = new CrossBuilder();

                cross.Print(2);

                string expected = string.Format("**{0}**{0}", Environment.NewLine);
                Assert.AreEqual <string>(expected, sw.ToString());
            }
        }
Example #2
0
        public void Print_WithHeightZero_PrintNothing()
        {
            using (StringWriter sw = new StringWriter())
            {
                Console.SetOut(sw);
                CrossBuilder cross = new CrossBuilder();

                cross.Print(0);

                string expected = "";
                Assert.AreEqual <string>(expected, sw.ToString());
            }
        }
Example #3
0
        public void Print_WithHeightFive_PrintAsterisksOdd()
        {
            using (StringWriter sw = new StringWriter())
            {
                Console.SetOut(sw);
                CrossBuilder cross = new CrossBuilder();

                cross.Print(5);

                StringBuilder sb = new StringBuilder();
                sb.Append(string.Format("*       *{0}", Environment.NewLine));
                sb.Append(string.Format("  *   *{0}", Environment.NewLine));
                sb.Append(string.Format("    *{0}", Environment.NewLine));
                sb.Append(string.Format("  *   *{0}", Environment.NewLine));
                sb.Append(string.Format("*       *{0}", Environment.NewLine));

                string expected = sb.ToString();
                Assert.AreEqual <string>(expected, sw.ToString());
            }
        }
Example #4
0
 public override void Build(Vector3i localPos, Vector3i worldPos, MeshData mesh, bool onlyLight)
 {
     CrossBuilder.BuildCross(localPos, worldPos, mesh, onlyLight);
 }
Example #5
0
 public static FA Difference(FA dfa1, FA dfa2)
 {
     return(CrossBuilder.Build(dfa1, dfa2, (s1, s2) => s1.Final && !s2.Final));
 }
Example #6
0
 public static FA Intersect(FA dfa1, FA dfa2)
 {
     return(CrossBuilder.Build(dfa1, dfa2, (s1, s2) => s1.Final && s2.Final));
 }
Example #7
0
 public static FA Union(FA dfa1, FA dfa2)
 {
     return(CrossBuilder.Build(dfa1, dfa2, (s1, s2) => s1.Final || s2.Final));
 }
Example #8
0
 public override MeshBuilder Build()
 {
     return(CrossBuilder.Build(this));
 }
Example #9
0
 public override void Build(Vector3i localPos, Vector3i worldPos, Map map, MeshBuilder mesh, bool onlyLight)
 {
     CrossBuilder.Build(localPos, worldPos, map, mesh, onlyLight);
 }
Example #10
0
 public static FA Substract(FA dfa1, FA dfa2)
 {
     return(CrossBuilder.Build(dfa1, dfa2, (s1, s2) => s1.IsFinal && !s2.IsFinal));
 }