Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- internal class Nodo
- {
- public Nodo(String lex, int dx, int dy)
- {
- X = dx;
- Y = dy;
- Nombre = lex;
- }
- public void Painter(Graphics g)
- {
- g.DrawImage(Image, X - 15, Y - 15);
- var drawFont = new Font("Arial", 16);
- var drawBrush = new SolidBrush(Color.Black);
- g.DrawString("" + Nombre, drawFont, drawBrush, X - 20, Y - 20);
- }
- public string Nombre { get; }
- public int X { get; private set; }
- public int Y { get; private set; }
- public void Transladar(int dx, int dy)
- {
- X += dx;
- Y += dy;
- }
- public Image Image { get; } //= Properties.Resources.esfera; //Descomentar
- public bool Haladopor(Point d) => Distance(d.X, d.Y) <= 15;
- public double Distance(int dx, int dy)
- {
- return Math.Sqrt((X - dx) * (X - dx) + (Y - dy) * (Y - dy));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement