internal void AddOrUpdateWire(int x, int y, CurrentType type, WireCurrentTransfer transfer) { List <Point> result = null; result = wireSolver.AddOrUpdateWire(x, y, type, transfer); foreach (Point t in result) { try { yaaaay[t].updateWireState(wireSolver.getWireTransfer(t)); } catch { } } StringBuilder sb = new StringBuilder(); foreach (Point t in result) { sb.AppendLine(t.ToString()); } }
internal void AddWire(RoomItem item, Point location, int rotation, InteractionType wireType) { WireCurrentTransfer transfer = WireCurrentTransfer.NONE; switch (wireType) { case InteractionType.wireCenter: { transfer = WireCurrentTransfer.DOWN | WireCurrentTransfer.LEFT | WireCurrentTransfer.RIGHT | WireCurrentTransfer.UP; break; } case InteractionType.wireCorner: { switch (rotation) { default: { transfer = WireCurrentTransfer.DOWN | WireCurrentTransfer.RIGHT; break; } case 2: { transfer = WireCurrentTransfer.DOWN | WireCurrentTransfer.LEFT; break; } case 4: { transfer = WireCurrentTransfer.UP | WireCurrentTransfer.LEFT; break; } case 6: { transfer = WireCurrentTransfer.RIGHT | WireCurrentTransfer.UP; break; } } break; } case InteractionType.wireSplitter: { switch (rotation) { default: { transfer = WireCurrentTransfer.UP | WireCurrentTransfer.DOWN | WireCurrentTransfer.RIGHT; break; } case 2: { transfer = WireCurrentTransfer.LEFT | WireCurrentTransfer.RIGHT | WireCurrentTransfer.DOWN; break; } case 4: { transfer = WireCurrentTransfer.UP | WireCurrentTransfer.DOWN | WireCurrentTransfer.LEFT; break; } case 6: { transfer = WireCurrentTransfer.LEFT | WireCurrentTransfer.RIGHT | WireCurrentTransfer.UP; break; } } break; } case InteractionType.wireStandard: { switch (rotation) { default: case 0: case 4: { transfer = WireCurrentTransfer.UP | WireCurrentTransfer.DOWN; break; } case 2: case 6: { transfer = WireCurrentTransfer.LEFT | WireCurrentTransfer.RIGHT; break; } } break; } } if (transfer == WireCurrentTransfer.NONE) { return; } List <Point> pointsToTrigger = wireSlower.AddOrUpdateWire(location.X, location.Y, CurrentType.OFF, transfer); //form.AddOrUpdateWire(location.X, location.Y, CurrentType.OFF, transfer); HandleItems(pointsToTrigger); }