public Move() { input = new DirEdge(this); Inputs = new Edge[] { input }; Outputs = new Edge[] { }; }
public SetNode() { input = new DirEdge(this); Inputs = new Edge[] { input }; Outputs = new Edge[] { }; }
public int TryGetStart(ref Side left, ref Side right) { Side center = this; DirEdge opp = Seg.GetOppositeEdge(Next.edge); if (center.CanGetEnd()) { left = center; right.Seg = opp.edge.segments[edgeDirs[Dir][opp.dir]]; right.Next = right.Seg.GetOppositeEdge(opp.edge); right.Dir = cubeDirs[opp.dir]; right.EndFound = false; return(right.CanGetEnd() ? 2 : 1); } center.Next = opp; if (center.CanGetEnd()) { left.Seg = Next.edge.segments[edgeDirs[Dir][Next.dir]]; left.Next = left.Seg.GetOppositeEdge(Next.edge); left.Dir = cubeDirs[Next.dir]; left.EndFound = false; right = center; return(left.CanGetEnd() ? 2 : 1); } return(0); }
public Side(Segment _seg, DirEdge _next, int _dir) { Seg = _seg; Next = _next; Dir = _dir; EndFound = false; }
public ConstDir() { input = new ControlFlow(this); output = new DirEdge(this); Inputs = new Edge[] { input }; Outputs = new Edge[] { output }; }
public GetNode() { input = new ControlFlow(this); output = new DirEdge(this); Inputs = new Edge[] { input }; Outputs = new Edge[] { output }; }
public EnemyNear() { input = new DirEdge(this); output = new BoolEdge(this); Inputs = new Edge[] { input }; Outputs = new Edge[] { output }; }
public Segment(DirEdge _start, DirEdge _end) { start = _start; end = _end; Used = -1; if (start != null && end != null) { start.edge.segments[start.dir] = this; end.edge.segments[end.dir] = this; comp = start.edge.conf + end.edge.conf; diagonal = (start.dir + end.dir) % 2 == 1; } }
private static void AddSegments(List <Segment> segments, Edge[] sides) { if (sides != null) { int conf = sides[0].conf + (sides[2].conf * 4); if (conf != 0 && conf != 15) { DirEdge[] edges = new DirEdge[4]; int count = 0; for (int n = 0; n < 4; n++) { if (sides[n].index != -1) { edges[count] = new DirEdge(n, sides[n]); count++; } } if (conf == 6) { DirEdge c = edges[0]; edges[0] = edges[2]; edges[2] = c; } for (int n = 0; n < 4; n += 2) { if (edges[n] != null) { if (sides[0].conf == 0 || sides[0].conf == 2) { segments.Add(new Segment(edges[n + 1], edges[n])); } else { segments.Add(new Segment(edges[n], edges[n + 1])); } } } } } }
public Attack() { input = new DirEdge(this); Inputs = new Edge[] { input }; Outputs = new Edge[] { }; }