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()); } }
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()); } }
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()); } }
public override void Build(Vector3i localPos, Vector3i worldPos, MeshData mesh, bool onlyLight) { CrossBuilder.BuildCross(localPos, worldPos, mesh, onlyLight); }
public static FA Difference(FA dfa1, FA dfa2) { return(CrossBuilder.Build(dfa1, dfa2, (s1, s2) => s1.Final && !s2.Final)); }
public static FA Intersect(FA dfa1, FA dfa2) { return(CrossBuilder.Build(dfa1, dfa2, (s1, s2) => s1.Final && s2.Final)); }
public static FA Union(FA dfa1, FA dfa2) { return(CrossBuilder.Build(dfa1, dfa2, (s1, s2) => s1.Final || s2.Final)); }
public override MeshBuilder Build() { return(CrossBuilder.Build(this)); }
public override void Build(Vector3i localPos, Vector3i worldPos, Map map, MeshBuilder mesh, bool onlyLight) { CrossBuilder.Build(localPos, worldPos, map, mesh, onlyLight); }
public static FA Substract(FA dfa1, FA dfa2) { return(CrossBuilder.Build(dfa1, dfa2, (s1, s2) => s1.IsFinal && !s2.IsFinal)); }