private void DrawTail(IBall ball) { ITail tail = tailManager.Find(ball); if (tail != null) { int i = 0; int opacity = 150; ball.GetSize(out int width, out int height); foreach (Vector2 position in tail) { ++i; if (i % 14 == 0) { if (opacity < 0) { break; } Color color = Color.Cyan; color.A = (byte)opacity; CircleShape circle = new CircleShape(); circle.Position = new Vector2f(position.X, position.Y); circle.Radius = (float)width / 2; circle.FillColor = color; render.Draw(circle); opacity = opacity - 60; } } } }
public void Add(IBall ball, ITail tail) { if (!tails.ContainsKey(ball)) { tails.Add(ball, tail); } }
private void DrawTail(Graphics g, IBall ball) { ITail tail = Game.TailManager.Find(ball); if (tail != null) { int i = 0; int opacity = 150; foreach (Position position in tail) { ++i; if (i % 12 == 0) { if (opacity < 0) { opacity = 0; } ball.GetSize(out var width, out var height); SolidBrush tailBrush = new SolidBrush(Color.FromArgb(opacity, Color.LightCoral)); g.FillEllipse( tailBrush, new Rectangle(position.X, position.Y, width, height)); tailBrush.Dispose(); opacity = opacity - 40; } } } }
protected override void OnViewAttached(object view, object context) { base.OnViewAttached(view, context); var tail = view as ITail; _tail = tail ?? new TailNull(); }
internal Parser(ITail logTail, IConfiguration configuration) { tail = logTail; rules = new List<IRule>(); if (configuration != null) { rules = configuration.Rules; } }
public bool Remove(ITail tail) { foreach (var pair in tails) { if (pair.Value == tail) { return(tails.Remove(pair.Key)); } } return(false); }
private void SavePosition(IBall ball) { ball.SavePosition(); ITail tail = tailManager.Find(ball); if (tail != null) { Vector2 position = new Vector2(ball.Boundary.Min.X, ball.Boundary.Min.Y); tail.Add(position); } }
public void SavePosition(IBall ball) { ball.SavePosition(); IElement element = ball as IElement; if (ball != null) { ITail tail = tailManager.Find(ball); if (tail != null) { Position position = new Position { X = element.PosX, Y = element.PosY }; tail.Add(position); } } }
public void FireBallTimerHandler(ITail tail, int value) { if (value <= 0) { if (tailManager.Remove(tail)) { counters.Remove(tail); } return; } if (!counters.Keys.Contains(tail)) { counters.Add(tail, value); } else { counters[tail] = value; } }
public Dog(IHunter hunter, ITail tail) { _hunter = hunter; _tail = tail; }
public CatDog(IHunter hunter, ITail tail, IValerian valerian) { _hunter = hunter; _tail = tail; _valerian = valerian; }