public Query( ILoggerFactory loggerFactory, IMapper mapper, Domain.Repository.Logix.IConnection logixConnectionRepository, Domain.Repository.Logix.ITag logixTagRepository, IBit commonBitRepository, Domain.Repository.Common.ITag commonTagRepository, Domain.Repository.Common.IConnection commonConnectionRepository, IAutomationType commonAutomationTypeRepository, IAnalogDigital commonAnalogDigitalRepository, ITagGroup commonTagGroupRepository, IInOut commonInOutRepository ) { _logger = loggerFactory.CreateLogger <Query>(); _mapper = mapper; _logixConnectionRepository = logixConnectionRepository; _logixTagRepository = logixTagRepository; _commonBitRepository = commonBitRepository; _commonTagRepository = commonTagRepository; _commonConnectionRepository = commonConnectionRepository; _commonAutomationTypeRepository = commonAutomationTypeRepository; _commonAnalogDigitalRepository = commonAnalogDigitalRepository; _commonTagGroupRepository = commonTagGroupRepository; _commonInOutRepository = commonInOutRepository; }
public void PrintSubDataType(int indnt, StreamWriter writer, IBit s) { if (s != null) { indent(indnt, writer); writer.Write("<IBit/>\n"); } }
public void Add(IBit bit) { if (_hasRendered) { throw new Exception("This Layout has already been rendered and new Bits cannot be added to it."); } Contents.Add(bit); }
public void Add(IBit bit) { if (bit is Link link) { if (_doHighlight) { link.Spec.IsHighlighted ??= () => link.Spec.URL !.Invoke() == _highlightedURL?.Invoke(); } _layout.Contents.Add(link); } else { _layout.Contents.Add(bit); } }
public Query ( ILoggerFactory loggerFactory, IAnalogDigital commonAnalogDigitalRepository, IInOut commonInOutRepository, IAutomationType commonAutomationTypeRepository, IConnection commonConnectionRepository, ITagGroup commonTagGroupRepository, IBit commonBitRepository ) { _logger = loggerFactory.CreateLogger <Query>(); _commonAnalogDigitalRepository = commonAnalogDigitalRepository; _commonInOutRepository = commonInOutRepository; _commonAutomationTypeRepository = commonAutomationTypeRepository; _commonConnectionRepository = commonConnectionRepository; _commonTagGroupRepository = commonTagGroupRepository; _commonBitRepository = commonBitRepository; }
private bool HorizontalDestruction() { int consecutives; int lastBit = -1; bool destruction = false; for (int j = 0; j < _boardSize.y; j++) { consecutives = 1; for (int i = 0; i < _boardSize.x; i++) { IBit currBit = _board[i, j]; if (currBit == null) { consecutives = 1; lastBit = -1; continue; } if (lastBit == currBit.Value()) { if (currBit is QuBit) { consecutives++; } } else { consecutives = 1; } lastBit = currBit.Value(); if (consecutives >= qubitsInRow) { DestroyCoalecentsHorizontal(new Vector2Int(i, j), lastBit); destruction = true; } } } return(destruction); }
private void EvaluateWinCondition() { bool win = true; for (int i = 0; i < _boardSize.x; i++) { for (int j = 0; j < _boardSize.y; j++) { IBit currBit = _board[i, j]; if (currBit is ClassicBit) { win = false; } } } if (win) { winSound.Play(); winCanvas.gameObject.SetActive(true); enabled = false; } }
public Dropdown ( IBit top, List <IBit>?contents = null, bool left = false ) { _top = top; _contents = contents ?? new List <IBit>(); _left = left; IEnumerable <string> classes = new[] { "Integrant.Element.Construct", "Integrant.Element.Construct.Dropdown", }; if (_left) { classes = classes.Append("Integrant.Element.Construct.Dropdown:Left"); } _classes = string.Join(' ', classes); }
public void Add(IBit bit) => _contents.Add(bit);