private DurationSquareDataChain GetDataChain(SquareClick squareClick) { DurationSquareDataChain durationChain = new DurationSquareDataChain(ActiveData.enemyState, ActiveData.durationEventState, ActiveData.movementState, (DurationSquareData)(markedClick.targetData), (DurationSquareData)(squareClick.targetData), GetRange(markedClick.coordinate, squareClick.coordinate), markedClick.coordinate, squareClick.coordinate); return(durationChain); }
private void EraseChain(DurationSquareDataChain targetChain) { foreach (DurationSquareData dataTarget in targetChain.complete) { dataTarget.Initialize(); } durationDataChains.Remove(targetChain); }
private void RightClick(SquareClick squareClick) { if (IsSquareMarked()) { markedClick = null; } else { DurationSquareDataChain targetedChain = GetTargetedChain(squareClick); if (targetedChain != null) { EraseChain(targetedChain); } } }
private void LeftClick(SquareClick squareClick) { if (squareClick.targetData.enemyType == EnemyType.none && !IsSquareMarked()) { markedClick = squareClick; } else if (squareClick.targetData.enemyType == EnemyType.none && IsSquareMarked() && squareClick.coordinate.Y >= markedClick.coordinate.Y) { //This is where the datachains are created DurationSquareDataChain durationChain = GetDataChain(squareClick); durationDataChains.Add(durationChain); markedClick = null; } else { markedClick = null; } }
private void LoadChains(List <String> dataTransfer) { dataTransfer.RemoveAt(0); while (dataTransfer.Count > 0) { String dataLine = dataTransfer[0]; dataTransfer.RemoveAt(0); MatchCollection gridMatches = Regex.Matches(dataLine, @"C:(\d+),(\d+) (\d+),(\d+):E: (\w+)"); foreach (Match match in gridMatches) { int startX = Convert.ToInt32(match.Groups[1].Value); int startY = Convert.ToInt32(match.Groups[2].Value); int endX = Convert.ToInt32(match.Groups[3].Value); int endY = Convert.ToInt32(match.Groups[4].Value); String elementData = match.Groups[5].Value; DurationSquareDataChain dataChain = new DurationSquareDataChain(elementData, new Coordinate(startX, startY), new Coordinate(endX, endY)); durationChains.Add(dataChain); } } }