public void RemoveObstacle(BTBLib.Obstacle value) { if (_obstaclesToDraw.Contains(value)) { _obstaclesToDraw.Remove(value); } }
public void AddObstacle(BTBLib.Obstacle value) { if (!_obstaclesToDraw.Contains(value)) { _obstaclesToDraw.Add(value); } }
private void UpdateTreeViewObstacles() { TreeNode obstaclesNode = GetObstaclesNode(); foreach (TreeNode node in obstaclesNode.Nodes) { TagData tagData = node.Tag as TagData; BTBLib.Obstacle obstacle = tagData.GetObstacleLink(); node.Checked = _drawData.ContainsObstacle(obstacle); } }
public void SetObstacle(bool show, BTBLib.Obstacle value) { if (show) { AddObstacle(value); } else { RemoveObstacle(value); } }
private void DrawObstacle(Graphics graphics, Color color, bool fill, BTBLib.Obstacle obstacle) { Pen pen = new Pen(color, 2.0f / _zoom); float radius = obstacle.Radius; // * 2; float size = radius * 2; int div = 8; graphics.DrawEllipse(pen, (obstacle.X - radius) / div, (_battle.Height - obstacle.Y - radius) / div, size / div, size / div); //graphics.DrawRectangle(pen, (obstacle.X - radius) / 8, (_battle.Height - obstacle.Y - radius) / 8, size, size); graphics.FillRectangle(new SolidBrush(color), (obstacle.X) / 8f - 0.5f, (_battle.Height - obstacle.Y) / 8f - 0.5f, 1f, 1f); }
public bool ContainsObstacle(BTBLib.Obstacle value) { return(_obstaclesToDraw.Contains(value)); }